Formatting
to also takes a format: decimal places, significant figures, a display
form, or a rounding step.
1/3 to 2 dp
1/3 to 3 sf
1 to 2 dp
12345.678 to 3 sf
1234567 to scientific
1234567 to engineering
1e-7 to nf
dp pads with zeros; sf does not. nf (normal form) forces a full
decimal expansion where smoot would otherwise switch to scientific notation.
nearest rounds to a step, which can be a number or a quantity.
1234.5 to nearest 10
12.347 to nearest 0.05
23 mm to nearest 5 mm
1 yard to nearest mm
Formats chain. A format applied to a multi-unit display rounds the last component.
80 kg to imperial to 0 dp
5 kg to lb, oz to 1 dp
A format is a value. Name one and reuse it.
money = 2 dp
style = imperial to 0 dp
1/3 to money
80 kg to style
as: change the display, keep the value
Section titled “as: change the display, keep the value”as changes how one line displays and nothing else. to changes the value
itself. The difference shows when you reuse the name later.
1/3 as 2 dp
a = 1/3 as 2 dp
a * 3
b = 1/3 to 2 dp
b * 3
The line naming a still shows the full value, because as applies only
where it is written.
as works with units too: 10 m as cm displays centimetres, but the value
stays 10 m for later arithmetic.
Document defaults
Section titled “Document defaults”A default line at the top of a document sets a knob for every line below
it.
default format: 2 dp
355 / 113
1 / 7
| Knob | Values |
|---|---|
default format: | 2 dp, 3 sf, scientific, auto |
default separator: | comma, underscore |
default grouping: | thousand, lakh, none |
default timezone: | an IANA zone such as Europe/Berlin |
default unit group: | metric, imperial, us |
Grouping is on by default. A per-line to always wins over a default.