Documentation / @ripl/utilities / formatNumber
Function: formatNumber()
formatNumber(
value,options?):string
Defined in: packages/utilities/src/number.ts:38
Formats a number as a locale-aware string. Supports decimal, percent, and currency styles; compact/scientific/engineering notation; grouping; and fraction-digit control (with precision as a shorthand for maximumFractionDigits). Non-numeric values fall back to String.
This is a standalone utility — it is passed values explicitly by axes, legends, and tooltips, and is intentionally never bound to a scale.
Parameters
| Parameter | Type |
|---|---|
value | unknown |
options | NumberFormatOptions |
Returns
string