Decimal Math.Round(Decimal, Int 32) Method
Rounds a decimal value to a specified number of fractional digits.
Definition
Namespace: Extreme.Mathematics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
C#
The number nearest to value that contains a number of fractional digits equal to decimals.
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
public static decimal Round(
decimal value,
int decimals
)
Parameters
- value Decimal
- A decimal number to be rounded.
- decimals Int32
- The number of decimal places in the return value.
Return Value
DecimalThe number nearest to value that contains a number of fractional digits equal to decimals.
Exceptions
Argument | decimals is less than 0 or greater than 28. |
Overflow | The result is outside the range of a System.Decimal. |