number and date
const { number, date } = useI18n()
number(12345.67, { style: 'currency', currency: 'USD' })
number(0.42, { style: 'percent' })
date(Date.UTC(2026, 0, 15, 12), {
dateStyle: 'long',
timeZone: 'UTC',
})
number
accepts the options of
Intl.NumberFormat;
date, those of
Intl.DateTimeFormat. The instances are reused per options within the translator.
| Name | Type / default | Description |
|---|---|---|
number
|
(value: number, options?: Intl.NumberFormatOptions) => string
| Currencies, percentages, decimals and other numeric representations. |
date
|
(value: Date | number, options?: Intl.DateTimeFormatOptions) => string
| A date or timestamp, formatted for the active language. |
Consistency between server and browser
Use the same date and set
timeZone
when the result must match in SSR and hydration. The playground uses a fixed date and UTC so you can compare the languages without depending on the clock or the time zone of the machine.
The currency is chosen with
currency; the language defines how it is presented, not a currency conversion.