Create BigInteger from a Decimal value in CSharp
Description
The following code shows how to create BigInteger from a Decimal value.
Example
/*w w w . ja v a2s.c o m*/
using System;
using System.Numerics;
public class Example
{
public static void Main()
{
decimal[] decimalValues = { -1.5m, -1.1m, 1.7m, 9.3m };
foreach (decimal decimalValue in decimalValues)
{
BigInteger number = new BigInteger(decimalValue);
Console.WriteLine(number);
}
}
}
The code above generates the following result.