Decimal Explicit Conversion (Decimal to Double)

 
System_CAPS_noteNote

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

equivalentCodeEntityM:System.Decimal.ToDouble(System.Decimal)

Defines an explicit conversion of a Decimal to a double-precision floating-point number.

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

F# does not support this operator

Parameters

value
Type: System.Decimal

The value to convert.

Return Value

Type: System.Double

A double-precision floating-point number that represents the converted Decimal.

This operation can result in a loss of precision, because a double-precision floating-point number has fewer significant digits than a Decimal.

This operator supports the explicit conversion of a Decimal to a Double. 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 a Double value by using C#, C++, and Visual Basic. To perform a conversion that is independent of language, you can call the ToDouble or the Convert.ToDouble(Decimal) method.

The following example converts Decimal numbers to Double values by using the explicit Decimal to Double 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
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: