C# Decimal Implicit(UInt64 to Decimal)

Description

Decimal Implicit(UInt64 to Decimal) defines an explicit conversion of a 64-bit unsigned integer to a Decimal.

Syntax

Decimal.Implicit(UInt64 to Decimal) has the following syntax.


public static implicit operator decimal (
  ulong value
)

Parameters

Decimal.Implicit(UInt64 to Decimal) has the following parameters.

  • value - The 64-bit unsigned integer to convert.

Returns

Decimal.Implicit(UInt64 to Decimal) method returns The converted 64-bit unsigned integer.

Example

The following example converts UInt64 values to Decimal numbers by using the UInt64 to Decimal conversion.


using System;/*from w  ww  .  j ava2s .c om*/

public class Example
{
    public static void Main()
    {
        // Convert value to a Decimal. 
        Decimal decValue = 123456789123456789;
        Console.WriteLine(decValue);         
    }
}

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