Converts a Decimal to a Currency.
[Visual Basic] Public Shared Function ToCurrency( _ ByVal d As Decimal _ ) As Currency [C#] public static Currency ToCurrency( Decimal d ); [C++] public: static Currency ToCurrency( Decimal d ); [JScript] public static function ToCurrency( d : Decimal ) : Currency;
The results of converting the argument to a Currency.
Exception Type | Condition |
---|---|
OverflowException | is thrown if the Decimal is less than Decimal.MinValue or greater than Decimal.MaxValue. |
The ToCurrency method converts a currency value to a Decimal value. Since a Currency has fewer significant digits than a Decimal, this operation may produce round-off errors.