Decimal Explicit Conversion (Single to Decimal)

 
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.

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

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

F# does not support this operator

Parameters

value
Type: System.Single

The single-precision floating-point number to convert.

Return Value

Type: System.Decimal

The converted single-precision floating point number.

Exception Condition
OverflowException

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

-or-

value is Single.NaN, Single.PositiveInfinity, or Single.NegativeInfinity.

The following example converts Single values to Decimal numbers by using the Single to Decimal conversion. This conversion requires the op_Explicit operator in Visual Basic.

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: