Variable: fmt
constfmt:object
Defined in: fmt.ts:133
Deferred formatters. Each returns a JSON-safe FormatValue to pass as a
msg() value; nothing is formatted until the reference is rendered.
Type Declaration
currency
currency: (
args) =>FormatValue
Parameters
| Parameter | Type |
|---|---|
args | { currency: string; maximumFractionDigits?: number; minimumFractionDigits?: number; value: number; } |
args.currency | string |
args.maximumFractionDigits? | number |
args.minimumFractionDigits? | number |
args.value | number |
Returns
date
date: (
args) =>FormatValue
Parameters
| Parameter | Type |
|---|---|
args | object & DateFormatOptions |
Returns
list
list: (
args) =>FormatValue
A list whose length the message cannot know, e.g. every field that failed validation. Each item renders in the reader's locale, then the locale's list format joins them — ICU messages have no loop.
Parameters
| Parameter | Type |
|---|---|
args | object & ListFormatOptions |
Returns
number
number: (
args) =>FormatValue
Parameters
| Parameter | Type |
|---|---|
args | { options?: NumberFormatOptions; value: number; } |
args.options? | NumberFormatOptions |
args.value | number |
Returns
percent
percent: (
args) =>FormatValue
Parameters
| Parameter | Type |
|---|---|
args | { maximumFractionDigits?: number; ratio: number; } |
args.maximumFractionDigits? | number |
args.ratio | number |
Returns
relativeTime
relativeTime: (
args) =>FormatValue
Parameters
| Parameter | Type |
|---|---|
args | { value: string | Date; } |
args.value | string | Date |