Method ToDecimal
ToDecimal()
Converts value of this instance to decimal number.
Declaration
public virtual Decimal ToDecimal()
Returns
Type | Description |
---|---|
Decimal | Value of this instance as decimal. |
Remarks
This conversion is valid only for numeric instances such as
IntegerValue, LongValue,
DoubleValue, NumberValue or instances
of StringValue containing valid numeric
representation.
Exceptions
Type | Condition |
---|---|
InvalidCastException | If this instance is not numeric and not StringValue. |
OverflowException | In a checked context, if this instance is numeric and represents value less than MinValue or greater than MaxValue |
FormatException | If this instance is StringValue and it does not contain valid numeric representation. |