Skip to main content
Version: Next

Number Formatting

Most chart types expose a Number format control (labeled D3 Format, Y Axis Format, or similar depending on the chart) wherever a metric or numeric axis can be formatted. This is available from the Customize tab, or from the metric's popover editor, depending on the chart type. Selecting one of the built-in presets below applies that formatting to the values Superset renders in the chart.

When an axis format control's chart has Comparison display set to Percentage (e.g. period-over-period comparisons), that control's choices are narrowed to percentage-only presets, hiding SMART_NUMBER, ~g, and the duration/memory/length presets.

You can also type a custom D3 format string directly into the control if none of the presets fit your needs.

Built-in presets

General

KeyDescription
SMART_NUMBERAdaptive formatting — automatically picks a reasonable precision based on the value
~gOriginal value, using D3's general-format specifier (trims trailing zeros; may switch to exponential notation for very large or small values)

D3 format strings

These are raw D3 format specifiers. The dropdown shows a live preview of each one against a sample value.

Format specWhat it does
,dInteger, comma-grouped thousands
.1sSI-prefix notation, 1 significant digit
.3sSI-prefix notation, 3 significant digits
,.1%Percentage, 1 decimal place, comma-grouped
.2%Percentage, 2 decimal places
.3%Percentage, 3 decimal places
.4rRounded to 4 significant digits
,.1fFixed-point, 1 decimal place, comma-grouped
,.2fFixed-point, 2 decimal places, comma-grouped
,.3fFixed-point, 3 decimal places, comma-grouped
+,Comma-grouped, always shows the sign
$,.2fCurrency, 2 decimal places, comma-grouped

Duration

KeyDescription
DURATIONDuration in ms (66000 => 1m 6s)
DURATION_SUBDuration in ms, with sub-second precision (1.40008 => 1ms 400µs 80ns)
DURATION_COLDuration in ms, colon-separated (10500 => 0:00:10.5)

Memory

KeyDescription
MEMORY_DECIMALMemory in bytes, decimal (1024B => 1.024kB)
MEMORY_BINARYMemory in bytes, binary (1024B => 1KiB)
MEMORY_TRANSFER_RATE_DECIMALMemory transfer rate in bytes, decimal (1024B => 1.024kB/s)
MEMORY_TRANSFER_RATE_BINARYMemory transfer rate in bytes, binary (1024B => 1KiB/s)

Distance / length

KeyDescription
LENGTHLength in meters, converted to kilometers (12345m => 12.35km)
LENGTH_CM_KMLength in centimeters, converted to kilometers (12345678cm => 123.46km)
LENGTH_CM_MLength in centimeters, converted to meters (12345cm => 123.45m)

Use these when a metric's underlying values are stored in meters or centimeters but are easier to read at a coarser unit — for example, distances traveled, cable/pipe lengths, or elevation changes.

Currency

Some chart types also expose currency-specific formatting, including a dynamic mode that reads the currency from a column value. See Dynamic Currency Formatting for details.