Package: effect
Module: BigDecimal
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 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 digitSee
round for configurable rounding with a RoundingModeceil for fixed rounding toward positive infinityfloor for fixed rounding toward negative infinitytruncate for fixed rounding toward zeroSignature
type RoundingMode = | "ceil"
| "floor"
| "to-zero"
| "from-zero"
| "half-ceil"
| "half-floor"
| "half-to-zero"
| "half-from-zero"
| "half-even"
| "half-odd"
Since v3.16.0