Skip to main content
TrueMath attaches units to values and converts between compatible units automatically. This page catalogs the supported units by dimension and explains how compound units and conversions behave. For how units are written inside activity equations, see Writing equations; for how unit numbers behave as a data type, see Unit numbers.

Simple units

Area and volume units also accept the typographic forms and . Time units can also be squared (s^2, hr^2, …); squared time is the time² denominator that appears in acceleration units such as m/s^2. Most units also accept their full names, singular or plural, including common spelling variants — ft can be written foot or feet, and m as meter, meters, metre, or metres. Unit suffixes are case-sensitive: USD is not usd, and Gbit is not gbit or GBIT. Use the exact casing shown above.

Compound units

A compound unit combines a unit from one dimension with a unit from another. Any simple unit from each constituent dimension can be paired, so velocity covers m/s, km/hr, ft/min, and every other length-over-time combination, not only the named shorthands. TrueMath also recognizes a few shorthand suffixes for common pairings. Cost and per-unit-count compounds are written directly from their constituent units, for example USD/hr, USD/ft^2, or ct/m^2.

Conversion behavior

  • Compatible units convert automatically. 1m + 10cm produces a length; you never convert by hand.
  • The result takes the first unit in the expression. 5in + 10ft is 125in, and 5hr + 6min is 5.1hr — the leading unit sets the result and the rest convert into it.
  • Multiplication and division derive dimensions. A length over a time is a velocity; a currency over an area is a cost-per-area.
  • Incompatible units are rejected. 5m + 3kg is an error rather than a wrong number. See Combining types.

Casting to a specific unit

To choose the unit a result is reported in, append a target unit to a parenthesized expression:
This returns the sum expressed in millimetres. Casting changes only the reported unit, not the underlying value, and the target must be compatible with the result’s dimension.
Angles are interpreted by the unit you attach: sin(45deg) and sin((pi/4)rad) are equivalent. See Trigonometry.