Value Formatting
Thousands separators, currency, and compact notation
Format displayed numbers with thousands separators, compact notation, or currency symbols. Raw values are preserved for calculations; only display output is affected.
Format Options
| Option | Type | Description |
|---|---|---|
thousands |
boolean | Add commas: 1000 → 1,000 |
compact |
boolean | Use suffixes: 1000 → 1K, 1000000 → 1M |
decimals |
number | Decimal places (default: 0, or 1 if compact) |
currency.symbol |
string | Currency symbol: $, €, etc. |
currency.position |
string | prefix (default) or suffix |
Thousands Separators
Add commas to large numbers:
charts:
revenue:
type: dot
title: Monthly Revenue
format:
thousands: true
file: charts/revenue.csv
- value
Result: 1234567 → 1,234,567
Compact Notation
Shorten large numbers with K/M/B suffixes:
charts:
users:
type: stacked-bar
title: User Growth
format:
compact: true
file: charts/users.csv
- value
Examples:
1500→1.5K2000000→2M3500000000→3.5B
Compact notation defaults to 1 decimal place. Override with decimals:
format:
compact: true
decimals: 0 # 1500 → 2K (rounded)
Currency Symbols
Add currency prefix or suffix:
charts:
sales:
type: dot
title: Sales by Region
format:
thousands: true
currency:
symbol: "$"
file: charts/sales.csv
- value
Result: 1234 → $1,234
Suffix Position
For currencies that follow the number (e.g., Euro in some locales):
format:
thousands: true
currency:
symbol: "€"
position: suffix
Result: 1234 → 1,234€
Decimal Places
Control precision with decimals:
format:
decimals: 2
Works with all formatting options:
format:
thousands: true
decimals: 2
currency:
symbol: "$"
# 1234.5 → $1,234.50
Scatter Chart Formatting
Scatter charts support separate formatting for X and Y axes:
charts:
scatter:
type: scatter
file: charts/data.csv
format:
x:
thousands: true
y:
compact: true
currency:
symbol: "$"
This applies different formatting to each axis independently.
Combining Options
Multiple formatting options can be combined:
format:
thousands: true # Add commas
compact: true # Use K/M/B (overrides thousands for large numbers)
decimals: 1 # One decimal place
currency:
symbol: "$" # Dollar sign prefix
Note: When both thousands and compact are true, compact takes precedence for numbers large enough to abbreviate.