f365.format, locale-aware formatting
Format dates, currencies, numbers, and file sizes using the user's locale, backed by Intl, no third-party library.
The f365.format namespace wraps the Intl APIs with a
tighter signature than the platform exposes. Locale defaults to
navigator.language; override per call when you need a fixed format.
Surface
| Property | Description |
|---|---|
date(value, opts?) | Format a date or ISO string. Defaults to the locale's short date. |
datetime(value, opts?) | Date + time. |
number(value, opts?) | Numeric formatting with grouping and decimals. |
currency(value, opts?) | Currency formatting. opts.currency ISO code (USD, EUR, AUD, etc.). |
bytes(value) | Human-readable file sizes, 1.2 MB, 345 kB. |
parseDate(string) | Inverse, locale-tolerant date parsing. |
Examples
Format a number as currency in the displayed label
const amount = f365.field('Amount').value;
f365.field('AmountFormatted').label =
`Confirm payment of ${f365.format.currency(amount, { currency: 'AUD' })}`;
Show file size next to an attachment
f365.field('Attachment').on('change', (file: File) => {
if (file) f365.field('AttachmentSize').value = f365.format.bytes(file.size);
});