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!

Currency.Round

Rounds a Currency value to a specified number of places.

[Visual Basic]
Public Shared Function Round( _
   ByVal c As Currency, _
   ByVal decimals As Integer _
) As Currency
[C#]
public static Currency Round(
   Currency c,
   int decimals
);
[C++]
public: static Currency Round(
   Currency c,
   int decimals
);
[JScript]
public static function Round(
   c : Currency,
   decimals : int
) : Currency;

Parameters

c
The Currency value to round.
decimals
The number of decimal places the Currency value is rounded to.

Return Value

The Currency value, rounded to the specified number of decimal places.

Exceptions

Exception Type Condition
ArgumentException If decimal is not between 0 and 4, inclusive.

Remarks

The Rounds method performs the arithmetic function of rounding the Currency value to the specified numbe of decimal places, which must be a number between 0 and 4, inclusively.

The operation performed by Round corresponds, conceptually, to evaluating Truncate, where the delta for positive values of the Currency value is 0.5 and for negative values of the Currency value is-0.5.

The decimals parameter returns the Currency value as an Int32.An argument exception is thrown if the decimal places to rounded is greater than four or less than zero.

See Also

Currency Structure | Currency Members | System Namespace