Model - Format functions
Every function callable as Format.* inside an expression — an argument input, a parameter binding, a table cell. Pure: no side effects, no async.
| Function | Returns | Description | Arg | Type | Meaning |
|---|---|---|---|---|---|
Format.currency(value, code, locale) | string | Locale currency display via Intl.NumberFormat, e.g. "$1,200.00". | value | number | the amount |
code | string | ISO 4217 currency code, default 'USD' | |||
locale | string | BCP 47 locale tag; omit for the runtime default | |||
Format.date(value, locale, style) | string | Locale date display via Intl.DateTimeFormat. | value | string | number | ISO date string or epoch ms — never "now" (time is host-injected state, keeps documents deterministic) |
locale | string | BCP 47 locale tag; omit for the runtime default | |||
style | string | Intl.DateTimeFormat dateStyle: 'full' | 'long' | 'medium' | 'short', default 'medium' | |||
Format.number(value, decimals, locale) | string | Grouped number display via Intl.NumberFormat, e.g. "1,234.50". | value | number | the number |
decimals | number | fixed decimal places; omit for locale default | |||
locale | string | BCP 47 locale tag; omit for the runtime default | |||
Format.percent(value, decimals, locale) | string | Percent display via Intl.NumberFormat, e.g. "42%" — value is the 0..1 fraction, not the already-scaled number. | value | number | 0..1 fraction |
decimals | number | decimal places, default 0 | |||
locale | string | BCP 47 locale tag; omit for the runtime default |