IRoundingStrategyRound Method

Returns a decimal rounded to the nearest value of 10^-n.

Definition

Namespace: InnerDrive.Financial
Assembly: InnerDrive.Financial (in InnerDrive.Financial.dll) Version: 5.2.9017.0
C#
decimal Round(
	decimal value,
	int decimals
)

Parameters

value  Decimal
The value to round to a given number of significant digits.
decimals  Int32
The number of significant digits to round the value.

Return Value

Decimal
A Decimal value rounded to a given number of significant digits.

Example

For the default rounding strategy, Round(123.4567, 1) would return 123.4, while Round(-123.4567, 2) would return -123.46.

Exceptions

ArgumentOutOfRangeExceptionThrown when decimals is less than 0 or greater than MaxDigits.

See Also