C# Decimal Explicit(Decimal to UInt64)
Description
Decimal Explicit(Decimal to UInt64)
defines an explicit
conversion of a Decimal to a 64-bit unsigned integer.
Syntax
Decimal.Explicit(Decimal to UInt64)
has the following syntax.
public static explicit operator ulong (
decimal value
)
Parameters
Decimal.Explicit(Decimal to UInt64)
has the following parameters.
value
- The value to convert.
Returns
Decimal.Explicit(Decimal to UInt64)
method returns A 64-bit unsigned integer that represents the converted Decimal.
Example
The following example converts Decimal numbers to UInt64 values by using the explicit Decimal to UInt64 conversion.
using System;/*from w w w .j av a 2s. co m*/
class MainClass
{
public static void Main( )
{
object Int64Value;
object UInt64Value;
Int64Value = (long)123.999M;
UInt64Value = (ulong)123.999M;
Console.WriteLine(Int64Value);
Console.WriteLine(UInt64Value );
}
}
The code above generates the following result.