RoundingModeRounding modes for BigDecimal.
When to use
Use with round to choose how discarded digits affect a BigDecimal
rounded to a target scale.
Details
ceil: round towards positive infinityfloor: round towards negative infinityto-zero: round towards zerofrom-zero: round away from zerohalf-ceil: round to the nearest neighbor; if equidistant round towards positive infinityhalf-floor: round to the nearest neighbor; if equidistant round towards negative infinityhalf-to-zero: round to the nearest neighbor; if equidistant round towards zerohalf-from-zero: round to the nearest neighbor; if equidistant round away from zerohalf-even: round to the nearest neighbor; if equidistant round to the neighbor with an even digithalf-odd: round to the nearest neighbor; if equidistant round to the neighbor with an odd digit
Source effect/BigDecimal.ts:170811 lines
export type type RoundingMode =
| "ceil"
| "floor"
| "to-zero"
| "from-zero"
| "half-ceil"
| "half-floor"
| "half-to-zero"
| "half-from-zero"
| "half-even"
| "half-odd"
Rounding modes for BigDecimal.
When to use
Use with round to choose how discarded digits affect a BigDecimal
rounded to a target scale.
Details
ceil: round towards positive infinity
floor: round towards negative infinity
to-zero: round towards zero
from-zero: round away from zero
half-ceil: round to the nearest neighbor; if equidistant round towards positive infinity
half-floor: round to the nearest neighbor; if equidistant round towards negative infinity
half-to-zero: round to the nearest neighbor; if equidistant round towards zero
half-from-zero: round to the nearest neighbor; if equidistant round away from zero
half-even: round to the nearest neighbor; if equidistant round to the neighbor with an even digit
half-odd: round to the nearest neighbor; if equidistant round to the neighbor with an odd digit
RoundingMode =
| "ceil"
| "floor"
| "to-zero"
| "from-zero"
| "half-ceil"
| "half-floor"
| "half-to-zero"
| "half-from-zero"
| "half-even"
| "half-odd"Referenced by 1 symbols