Decimal..::..Round Method (Decimal, Int32)
Rounds a Decimal value to a specified number of decimal places.
Namespace:
SystemAssembly: Bridge (in Bridge.dll)
Syntax
[TemplateAttribute] public static decimal Round( decimal d, int decimals )
<TemplateAttribute> _ Public Shared Function Round ( _ d As Decimal, _ decimals As Integer _ ) As Decimal
[TemplateAttribute] public: static Decimal^ Round( Decimal^ d, int^ decimals )
Parameters
- d
- Type: System..::..Decimal
A decimal number to round.
- decimals
- Type: System..::..Int32
A value from 0 to 28 that specifies the number of decimal places to round to.
Return Value
The decimal number equivalent to d rounded to decimals number of decimal places.Exceptions
Exception | Condition |
---|---|
System..::..ArgumentOutOfRangeException | decimals is not a value from 0 to 28. |