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

FormatInputOutput
$0,0146000$146,000
0,05000050,000
0.0%0.0656.5%
0[.]01.231.2
$0,0.001234.5$1,234.50
0o33rd

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/d formats 1.5 as .
  • 0[.]00n/d formats 1.2345 as 1.23 (the value rounds before the fraction substitution kicks in).
🚧

Plain numbers only

n/d does not combine with abbreviation, ordinal, percent, or currency tokens.

Dates

Date format strings follow date-fns format.

Common date formats

FormatInputOutput
MM/dd/yyyy2026-04-1504/15/2026
MMMM d, yyyy2026-04-15April 15, 2026
yyyy2026-04-152026