Skip to content

Decimal Format ​

The :decimal.N format controls decimal precision, displaying exactly N decimal places.

Interactive Example ​

Try It
TABLE
  ROWS occupation * gender
  COLS education * income.mean:decimal.2
;
Dataset:samplesoccupation, education, gender, income
Try Variations

Query Breakdown ​

  • income.mean:decimal.2 - Formats the average income with exactly 2 decimal places (1234.57)
  • :decimal.1 - One decimal place
  • :decimal.3 - Three decimal places

The number after the dot specifies the precision. Use decimal format when you need consistent decimal alignment in your tables.

Powered by Malloy and DuckDB