Unit Statement

Identifies a unit of measure.

Syntax

Usual construct

[ @SI ] Unit unit_names [ = expression ]

Interval-scale construct

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

Parts

@SI
Optional indication of an SI (metric) unit.
unit_names
Mandatory one or more names with spaces between each. All names identify the same unit.

Unit name

[ number ] { name | name + suffix | prefix - name }
name
Mandatory basic name for a unit of measure.
number
One of the integer literals that follow:
  • 1name is irregular and grammatically singular. For example, «1 foot».
  • 2name is irregular and grammatically plural. For example, «2 feet».
  • 0name is grammatically singular for zero and one. This occurs in some languages, for example, French. You can use 0 (and no others) with suffix or prefix.
suffix
Mandatory after +. Identifies the regular plural suffix for name. For example, «metre+s» or «inch+es».
prefix
Mandatory before a hyphen (-). Identifies the regular plural prefix for name. This occurs in some languages, most frequently in Africa. For example, in Swahili, «ma-debe».
expression
A conversion factor.
Optional in the usual construct.
Mandatory in the interval-scale construct.
parameter
Mandatory in the interval-scale construct. You use it with expression for a unit with an interval scale, for example, 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 Celsius 1 degree_C 2 degrees_C (k In Kelvin) = k + 273.15

See also