Developer Guide
Rounding
RoundingMode accepts the classic BigDecimal mode names:
| Mode | Behavior |
|---|---|
UP | Away from zero |
DOWN | Toward zero (truncation) |
CEILING | Toward +∞ |
FLOOR | Toward −∞ |
HALF_UP | Nearest, ties away from zero — default, matches PG round() |
HALF_DOWN | Nearest, ties toward zero |
HALF_EVEN | Nearest, ties to even digit (banker's rounding) |
Where modes apply
Code
Related transforms
trunc(d)— integer part (toward zero)floor(d)/ceil(d)— integer toward −∞ / +∞normalize(d)— strip trailing zeros (12.3400→12.34;v/scaleminimized). Note:normalizechangesscale, sostrictEqon a normalized and un-normalized equal value isfalse— useeqfor value comparison.
Last modified on