Formats
Any Variable can be formatted for textual display.
variables[].format defines how a Variable's value should be displayed. The API applies the format and returns the result in valueFormatted. Formatting is most commonly used for Number, Percent, and Date Variables.
{
"format": "0[.]0",
"value": 1.23,
"valueFormatted": "1.2"
}See Variables: Format for the broader Variables context.
Numbers
Number format strings follow Numeral.js.
Common format strings
| Format | Input | Output |
|---|---|---|
$0,0 | 146000 | $146,000 |
0,0 | 50000 | 50,000 |
0.0% | 0.065 | 6.5% |
0[.]0 | 1.23 | 1.2 |
$0,0.00 | 1234.5 | $1,234.50 |
0o | 3 | 3rd |
Custom formats
Taffrail adds a n/d token that converts a fraction to its Unicode equivalent — for example, 1/2 becomes ½.
n/d composes with Numeral format strings. The portion before n/d is the Numeral format applied to the integer part:
0.0n/dformats1.5as1½.0[.]00n/dformats1.2345as1.23(the value rounds before the fraction substitution kicks in).
Plain numbers only
n/ddoes not combine with abbreviation, ordinal, percent, or currency tokens.
Dates
Date format strings follow date-fns format.
Common date formats
| Format | Input | Output |
|---|---|---|
MM/dd/yyyy | 2026-04-15 | 04/15/2026 |
MMMM d, yyyy | 2026-04-15 | April 15, 2026 |
yyyy | 2026-04-15 | 2026 |
Updated 4 days ago
