DecimalMath.Round(Decimal, Int32) 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#
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

Decimal
The number nearest to value that contains a number of fractional digits equal to decimals.

Exceptions

ArgumentOutOfRangeException decimals is less than 0 or greater than 28.
OverflowException The result is outside the range of a System.Decimal.

See Also