NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Decimal.ToCurrency

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;

Parameters

d
A Decimal value to convert.

Return Value

The results of converting the argument to a Currency.

Exceptions

Exception Type Condition
OverflowException is thrown if the Decimal is less than Decimal.MinValue or greater than Decimal.MaxValue.

Remarks

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.

See Also

Decimal Structure | Decimal Members | System Namespace