Rounds a Decimal value to a specified number of decimal places.
[Visual Basic] Public Shared Function Round( _ ByVal d As Decimal, _ ByVal decimals As Integer _ ) As Decimal [C#] public static Decimal Round( Decimal d, int decimals ); [C++] public: static Decimal Round( Decimal d, int decimals ); [JScript] public static function Round( d : Decimal, decimals : int ) : Decimal;
The value specified by d rounded to the number of decimal places specified by the number of decimal places.
Exception Type | Condition |
---|---|
ArgumentException | is thrown if the number of decimal places are not between 0 and 28, inclusive. |
The operation Round conceptually corresponds to evaluating Truncate.