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