toString
Returns a string representation of the value.
Summary
Use it for compact exact string output. Use toFixed when fixed decimal places are required.
AI Contract
Signature
Parameters
Returns
Returns a string.
Behavior
- Without
base, uses base 10 and followsEXPONENTIAL_ATfor exponential notation. - With
base, converts usingALPHABETand rounds according toDECIMAL_PLACESandROUNDING_MODE. - Non-finite values return
NaN,Infinity, or-Infinity.
Examples
Errors
- Throws if
baseis 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.