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;
The Currency value, rounded to the specified number of decimal places.
Exception Type | Condition |
---|---|
ArgumentException | If decimal is not between 0 and 4, inclusive. |
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.