Decimal Explicit Conversion (Decimal to Int64)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.


Defines an explicit conversion of a Decimal to a 64-bit signed integer.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

F# does not support this operator


Type: System.Decimal

The value to convert.

Return Value

Type: System.Int64

A 64-bit signed integer that represents the converted Decimal.

Exception Condition

value is less than Int64.MinValue or greater than Int64.MaxValue.

This operator supports the explicit conversion of a Decimal to a Int64. The syntax for such explicit conversions is language-dependent, and individual language compilers can provide different implementations and return different results. The example illustrates the different return values when you explicitly convert a Decimal value to an Int64 value by using C# and Visual Basic. To perform a conversion that is independent of language, you can call the ToInt64 or the Convert.ToInt64(Decimal) method.

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

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top