DefaultRoundingStrategyRound Method
Returns a decimal rounded to the nearest value of 10^-n.
Namespace: InnerDrive.FinancialAssembly: InnerDrive.Financial (in InnerDrive.Financial.dll) Version: 5.2.9017.0
public decimal Round(
decimal value,
int decimals
)
- value Decimal
- The value to round to a given number of significant digits.
- decimals Int32
- The number of significant digits to round the value.
DecimalThe number nearest
value with precision equal to
decimals. If
value is halfway between
two numbers, one of which is even and the other odd, then the even number is returned.
If the precision of
value is less than
decimals,
then
value is returned unchanged.
IRoundingStrategyRound(Decimal, Int32)
The behavior of this method follows IEEE Standard 754, section 4. This kind of rounding is
sometimes called rounding to nearest, or banker's rounding.
If decimals is zero, this kind of rounding
is sometimes called rounding toward zero.
For the default rounding strategy, Round(123.4567, 1) would
return 123.4, while Round(-123.4567, 2) would return -123.46.