Unit Statement

Defines a unit of measure.

Syntax

Usual construct

[ @SI ] Unit name(s) [ = expression ]

Offset-scale construct

[ @SI ] Unit ( parameter In unit ) name(s) = expression

Parts

@SI
Optional indication of an SI unit.
name(s)
Mandatory one or more names with a space between each. All names identify the same unit. You can give the plurals of names with parentheses, such as “meter(s)”.
expression
A conversion factor.
Optional in the usual construct.
Mandatory in the offset-scale construct.
parameter
Mandatory in the offset-scale construct. You use it with expression for a unit with an offset scale, such as a unit of temperature.
unit
A different unit that is related to this unit.

Instructions

TODO

Examples

@SI Unit meter(s) metre(s) m
Unit light_year(s) ly = 9.4605284 petameters
Unit Kelvin K
Unit (k In Kelvin) degree_C degrees_C = k + 273.15

See also