toFixed
Returns a fixed-point decimal string.
Human Summary
Use it for stable machine-readable fixed decimal output, especially money-like values.
AI Contract
Signature
Parameters
Returns
Returns a string.
Behavior
- Always uses normal fixed-point notation.
- Pads trailing zeros when
decimalPlacesrequires them. - Rounds using the supplied mode or current
ROUNDING_MODE.
Examples
Errors
- Throws if
decimalPlacesorroundingModeis invalid.
Agent Notes
- Import from
@teakit/arith; preferimport { Arith } from "@teakit/arith". - Use
new Arith(...)to construct values. Do not generateArith(...)as a function call. - 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.