C# Decimal Decimal(UInt64)

Description

Decimal Decimal(UInt64) initializes a new instance of Decimal to the value of the specified 64-bit unsigned integer.

Syntax

Decimal.Decimal(UInt64) has the following syntax.


[CLSCompliantAttribute(false)]
public Decimal(
  ulong value
)

Parameters

Decimal.Decimal(UInt64) has the following parameters.

  • value - The value to represent as a Decimal.

Example

The following code example creates several Decimal numbers using the constructor overload that initializes a Decimal structure with a UInt64 value.


/*from   w w  w  . j a  v a 2  s . c om*/
using System;

class DecimalCtorLDemo
{
    public static void Main( )
    {
        decimal decimalNum = new decimal( 999999999999999999 );

        Console.WriteLine( decimalNum );
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version