Mono Class Library: System.Decimal Overview | Members

System.Decimal Constructor

Constructs and initializes a new decimal value.

public Decimal (double value)

Parameters

value
The double value used to initialize the new decimal.

Exceptions

TypeReason
OverflowException

value is one of the following:

greater than decimal.MaxValue

less than decimal.MinValue

equal to double.NaN, but the Decimal representation does not support NaNs.

equal to double.PositiveInfinity, but the Decimal representation does not support infinities.

equal to double.NegativeInfinity, but the Decimal representation does not support infinities.

Remarks

This constructor initializes the new decimal to the value specified by value. This constructor rounds value to 15 significant digits using banker's rounding. The scale of the new decimal is the same as that produced by decimal.Parse(value.ToString()).

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0