C# Decimal ToInt64
Description
Decimal ToInt64
converts the value of the specified Decimal
to the equivalent 64-bit signed integer.
Syntax
Decimal.ToInt64
has the following syntax.
public static long ToInt64(
decimal d
)
Parameters
Decimal.ToInt64
has the following parameters.
d
- The decimal number to convert.
Returns
Decimal.ToInt64
method returns A 64-bit signed integer equivalent to the value of d.
Example
The following example uses the ToInt64 method to convert decimal numbers to Int64 values.
//from w w w . j a va 2 s .co m
using System;
class Example
{
public static void Main( )
{
long number = Decimal.ToInt64(123.999m);
Console.WriteLine(number);
}
}
The code above generates the following result.