This documentation is archived and is not being maintained.

Convert.ToUInt64 Method (Decimal)

.NET Framework 1.1

Converts the value of the specified Decimal number to an equivalent 64-bit unsigned integer.

This method is not CLS-compliant. For more information about CLS compliance, see What is the Common Language Specification.

[Visual Basic]
Overloads Public Shared Function ToUInt64( _
   ByVal value As Decimal _
) As UInt64
public static ulong ToUInt64(
 decimal value
public: static unsigned __int64 ToUInt64(
 Decimal value
static function ToUInt64(
 value : Decimal
) : UInt64;


A Decimal number.

Return Value

value rounded to the nearest 64-bit unsigned integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.


Exception Type Condition
OverflowException value is less than zero or greater than UInt64.MaxValue.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

Convert Class | Convert Members | System Namespace | Convert.ToUInt64 Overload List