NumberFormatter
Format number with thousands/decimal separators and suffix/prefix
Source
LLM docs
Docs
Package
Usage
Use NumberFormatter to format numbers. It supports the same formatting-related props
as the NumberInput component.
$ 1,000,000
Prefix and suffix
Set the prefix and suffix props to add a given string to the start or end of the value:
With prefix: $ 100
With suffix: 100 RUB
Thousands separator
Set the thousandSeparator prop to separate thousands with a character. You can control
the grouping logic with thousandsGroupStyle, which accepts: thousand, lakh, wan, none values.
With default separator: 1,000,000
With custom separator: 1.000.000
Decimal scale
The decimalScale prop controls the number of allowed decimal places:
1.67