Skip to Content
DocsResourcesShowcase

Format Number

Used to format numbers to a specific locale and options

SourceStorybookArk

1,450.45

The number formatting logic is handled by the native Intl.NumberFormat API and smartly cached to avoid performance issues when using the same locale and options.

import { FormatNumber } from "@chakra-ui/react"
<FormatNumber value={1000} />

Use the style=percentage prop to change the number format to percentage.

14.50%

Use the style=currency prop to change the number format to currency.

$1,234.45

Wrap the FormatNumber component within the LocaleProvider to change the locale.

de-DE

1.450,45

zh-CN

1,450.45

Use the style=unit prop to change the number format to unit.

384.4 km

Use the notation=compact prop to change the number format to compact notation.

1.5M

The FormatNumber component supports all Intl.NumberFormat options in addition to the following props:

PropDefaultType
value *
number

The number to format

Previous

For

Next

FormatByte