Share via


Decimal Constructor (Single)

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Initializes a new instance of Decimal to the value of the specified single-precision floating-point number.

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

Syntax

'Declaration
Public Sub New ( _
    value As Single _
)
public Decimal(
    float value
)
public:
Decimal(
    float value
)
new : 
        value:float32 -> Decimal
public function decimal(
    value : float
)

Parameters

Remarks

This constructor rounds value to 7 significant digits using rounding to nearest. This is done even if the number has more than 7 digits and the less significant digits are zero.

.NET Framework Security

See Also

Reference

Decimal Structure

Decimal Overload

System Namespace