#fmt-number Writing templates
Formats a number and its unit as the report prints them: «1.902 kN/m²».
#fmt-number(, )Hover an argument: what it does. Hover its value: every possible value. A click keeps the bubble open.
valuerequiredThe number to print.
unitrequiredIts unit, "" if dimensionless.
The essentials
A template's building blockWhat Woodcore's own commands use; a report seldom needs it.
The document's decimalsThe number of decimals follows
number-digits, as everywhere in the report.Without a var objectFor a value computed in Typst;
fmt-value reads a var object.Arguments
| Argument | Status | What it does, and examples |
|---|---|---|
| The line's arguments | ||
| required | The number to print. #fmt-number(1.7291232, "kN/m²")1.729 kN/m²#fmt-number(12, "kN")an integer, no decimals | |
| required | Its unit, "" if dimensionless. #fmt-number(0.9, "")the number alone"kNm"a unit of the report | |
Lines to copy
Minimal call
#fmt-number(1.729, "kN/m²")Examples
#fmt-number(1.7291232, "kN/m²")#fmt-number(0.9, "")Defined in lib/calc-engine-core.typ:634