Return x rounded to the specified precision.
Declared in <bdldfp_decimalimputil.h>
static
ValueType32
round(
ValueType32 x,
unsigned int precision);
Round halfway cases away from zero, regardless of the current decimal floating point rounding mode. If x is integral, positive zero, negative zero, NaN, or infinity then return x itself.
Examples: round(3.14159, 3) ==> 3.142
x rounded to the specified precision
| Name | Description |
|---|---|
| x | value to round |
| precision | number of digits after the decimal point |