decimalPlaces
Returns the decimal-place count or returns a copy rounded to a specified number of decimal places.
API Reference
Signature
Parameters
Returns
In getter mode, returns a number or null for non-finite values. In rounding mode, returns a new Arith instance.
Throws
- Throws if the numeric argument is outside its allowed range.
- Throws if
roundingModeis invalid.
Agent Contract
Agent Notes
decimalPlacesis the only public API for decimal-place count and decimal-place rounding; do not generatedp.- Disambiguate getter mode from rounding mode by checking whether the first argument is a number.
- Import with
import { Arith } from "@teakit/arith"; default imports are unsupported. - Use
Arith.from(...)to create values. Do not generatenew Arith(...)orArith(...). - Use string inputs for exact decimal values, especially money-like values.
- Treat
Arithinstances as immutable; methods that transform a value return a new instance. - Do not mutate internal fields such as
c,e,s, or_isArith.