Hyperlinkv0.8.0-beta.28

BigDecimal

BigDecimal.RoundingModetypeeffect/BigDecimal.ts:1708
RoundingMode

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
export type 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