Document Stack
Document Stack
Docs

Date & Number Formatting

Format dates, numbers, and currencies with localized formats and custom patterns.

Overview

When you pass raw data like 2026-02-08 or 4250.00 to a template, you probably want it displayed as "February 8, 2026" or "$4,250.00". Document Stack includes built-in formatters for dates, numbers, and currencies.

Date Formatting

Pass dates as ISO 8601 strings in your API data. Then set the display format on the field element in the inspector.

Built-in Date Formats

FormatExample Output
Short02/08/2026
MediumFeb 8, 2026
LongFebruary 8, 2026
FullSunday, February 8, 2026
ISO2026-02-08
Relative3 days ago

Custom Date Patterns

text
DD/MM/YYYY     → 08/02/2026
MM-DD-YYYY     → 02-08-2026
YYYY-MM-DD     → 2026-02-08
MMM DD, YYYY   → Feb 08, 2026
MMMM DD, YYYY  → February 08, 2026
DD MMMM YYYY   → 08 February 2026

Date Input Format

Always send dates as ISO 8601 strings (YYYY-MM-DD orYYYY-MM-DDTHH:mm:ssZ) in your API data. The display format is applied by the template.

Number Formatting

Format numbers with thousands separators, decimal places, and custom prefixes or suffixes.

Built-in Number Formats

FormatInputOutput
Integer1234.561,235
Decimal (2)1234.51,234.50
Decimal (4)0.123450.1235
Percentage0.12512.5%
Compact15000001.5M

Currency Formatting

Currency formatting adds the appropriate symbol, thousands separator, and decimal places based on the currency code:

CurrencyInputOutput
USD4250$4,250.00
EUR4250€4.250,00
GBP4250£4,250.00
JPY4250¥4,250
INR4250₹4,250.00

Setting Currency Format

  1. Select the field element
  2. In the inspector, set Format to Currency
  3. Choose the currency code (USD, EUR, GBP, etc.)
  4. Pass raw numeric values in your API data — the template handles formatting
JSON
{
  "data": {
    "subtotal": 4250,
    "tax": 361.25,
    "total": 4611.25
  }
}
Pass numbers as raw numeric values (not pre-formatted strings) so the template can apply consistent formatting. Sending 4250 is better than "$4,250.00".

Locale Settings

Date and number formats adapt to the locale you set on the template:

  • en-US — February 8, 2026 / $4,250.00 / 1,234.56
  • en-GB — 8 February 2026 / £4,250.00 / 1,234.56
  • de-DE — 8. Februar 2026 / 4.250,00 € / 1.234,56
  • fr-FR — 8 février 2026 / 4 250,00 € / 1 234,56
  • ja-JP — 2026年2月8日 / ¥4,250 / 1,234.56

Next Steps