The following rounding modes are used with ICU's Decimal Formatter. Note that ICU's use of the terms "Down" and "Up" here are somewhat at odds with other definitions, but are equivalent to the same modes used in Java's JDK.
Comparison of Rounding Modes
This chart shows the values -2.0 through 2.0 in increments of 0.1, and shows the resulting ICU format when formatted with no decimal digits.
This is ICU's default rounding mode. Values exactly on the 0.5 (half) mark (shown dotted in the chart) are rounded to the nearest even digit. This is often called Banker's Rounding because it is, on average, free of bias. It is the default mode specified for IEEE 754 floating point operations.
Also known as ties-to-even, round-to-nearest, RN or RNE.
Values exactly on the 0.5 (half) mark are rounded down (next smaller absolute value, towards zero).
Values exactly on the 0.5 (half) mark are rounded up (next larger absolute value, away from zero).
All values are rounded towards the next smaller absolute value (rounded towards zero, or RZ).
Also known as: truncation, because the insignificant decimal places are simply removed.
All values are rounded towards the next greater absolute value (away from zero).
All values are rounded towards positive infinity (+∞). Also known as RI for Rounds to Infinity.
All values are rounded towards negative infinity (-∞). Also known as RMI for Rounds to Minus Infinity.
The mode "Unnecessary" doesn't perform any rounding, but instead returns an error if the value cannot be represented exactly without rounding.