Skip to content

Prefix

A “prefix” scales a unit by some magnitude, and prepends a prefix symbol to the unit’s label.

TODO: this page is a stub

We will provide a full-fledged reference for prefixes later. For now, here are the basics:

  1. We support every SI prefix and binary prefix.

  2. To apply a prefix to a unit type, spell the prefix using CamelCase (just like any other type in Au), and pass the unit type as a template parameter.

    • Example: Meters is a unit type; so is Centi<Meters>. You can form a QuantityD<Centi<Meters>>.
  3. To apply a prefix to a quantity maker, spell the prefix using snake_case (just like the quantity maker itself), and pass the quantity maker as a function parameter.

    • Example: meters is a quantity maker; so is centi(meters). If you call centi(meters)(2.54), it will create a quantity of centimeters.