API / Utilities / FormatNumberOptions
Defined in: src/libs/format-number/types.ts:56
Extends
Properties
| Property | Type | Description |
|---|---|---|
format? |
"number" | "percent" |
Display mode for the numeric value. - 'number' — plain number (default). - 'percent' — value is multiplied by 100 and rendered with a % suffix. Combining 'percent' with units is not meaningful and should be avoided. |
labelMode? |
string |
Internal rendering hint for axis label layout. Not intended for public use. |
lang? |
string |
BCP 47 language tag used for locale-aware formatting (e.g. 'en', 'ru'). Defaults to the application locale when omitted. |
multiplier? |
number |
Factor applied to the value before formatting. For example, multiplier: 1000 converts seconds to milliseconds. |
postfix? |
string |
String appended to the formatted value (e.g. ' USD'). |
precision? |
number | "auto" |
Number of decimal places to display. Use 'auto' to determine precision automatically based on the value magnitude. |
prefix? |
string |
String prepended to the formatted value (e.g. '$'). |
showRankDelimiter? |
boolean |
When true, inserts a thousands separator (e.g. 1 500 000). |
units? |
FormatUnitScaleEntry | FormatUnitScale |
Custom unit scale, or a single FormatUnitScaleEntry as sugar for locking every value to one unit. Unit selection is always automatic: the entry with the largest factor such that ` |
Previous
Next