Formatting values

Dates, numbers, currency, percent and yes or no. Data and expressions in the DocStudio designer user guide.

Raw values often need formatting: a date as text, a number with separators, an amount with a currency.

Apply a format

In the expression editor, choose Format as and pick the kind. The editor offers options for each kind and previews the result with the page locale.

Format Value Options
Date An ISO 8601 text such as 2026-03-05 or a time in milliseconds Style short, medium, long, full or iso; a time zone name (UTC by default)
Number A number Decimals 0 to 20
Currency A number The three-letter code such as USD (required) and decimals
Percent A ratio such as 0.256 Decimals (default 0)
Yes or no A boolean The texts for true and false

Examples (English locale)

Input Result
2024-03-05 as medium date Mar 5, 2024
1234.5 as number 1,234.5
1234.5 as USD currency $1,234.50
0.256 as percent 26%
true as yes or no Yes

Locale

The page locale setting (for example en, ar, ur) controls separators, month names and digit shapes. Exact output for Arabic and Urdu depends on the browser or Node version.

Invalid input

An invalid value (for example free-form date text) gives an empty result and a warning. Dates must be ISO 8601.

Host formatters

A host can register extra formatters and describe them for the editor. A formatter without a description can still be used as a raw call with Edit as JSON.