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.Round

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;

Parameters

d
The Decimal value to round.
decimals
The number of decimal places to round to; it must be between 0 and 28, inclusive.

Return Value

The value specified by d rounded to the number of decimal places specified by the number of decimal places.

Exceptions

Exception Type Condition
ArgumentException is thrown if the number of decimal places are not between 0 and 28, inclusive.

Remarks

The operation Round conceptually corresponds to evaluating Truncate.

See Also

Decimal Structure | Decimal Members | System Namespace