Coding of units

Units are coded with one byte indicating the unit type, and one byte indicating the display type of the unit. The SI unit or standard unit always has display type 0. The display types for each unit type are provided on the following page. The unit types as defined currently are:

code unit name unit description default (SI) unit Display types
0 Dimensionless Unit without a dimension [] Display types
1 Acceleration Acceleration [m/s2] Display types
2 AngleSolid Solid angle [steradian] Display types
3 Angle Angle (relative) [rad] Display types
4 Direction Angle (absolute) [rad] Display types
5 Area Area [m2] Display types
6 Density Density based on mass and length [kg/m3] Display types
7 ElectricalCharge Electrical charge (Coulomb) [sA] Display types
8 ElectricalCurrent Electrical current (Ampere) [A] Display types
9 ElectricalPotential Electrical potential (Volt) [kgm2/s3A] Display types
10 ElectricalResistance Electrical resistance (Ohm) [kgm2/s3A2] Display types
11 Energy Energy (Joule) [kgm2/s2] Display types
12 FlowMass Mass flow rate [kg/s] Display types
13 FlowVolume Volume flow rate [m3/s] Display types
14 Force Force (Newton) [kgm/s2] Display types
15 Frequency Frequency (Hz) [1/s] Display types
16 Length Length (relative) [m] Display types
17 Position Length (absolute) [m] Display types
18 LinearDensity Linear density [1/m] Display types
19 Mass Mass [kg] Display types
20 Power Power (Watt) [kgm2/s3] Display types
21 Pressure Pressure (Pascal) [kg/ms2] Display types
22 Speed Speed [m/s] Display types
23 Temperature Temperature (relative) [K] Display types
24 AbsoluteTemperature Temperature (absolute) [K] Display types
25 Duration Time (relative) [s] Display types
26 Time Time (absolute) [s] Display types
27 Torque Torque (Newton-meter) [kgm2/s2] Display types
28 Volume Volume [m3] Display types
100 Money Money (cost in e.g., $, €, ...) [$] Display types
101 MoneyPerArea Money/Area (cost/m2) [$/m2] Display types
102 MoneyPerEnergy Money/Energy (cost/W) [$s3/kgm2] Display types
103 MoneyPerLength Money/Length (cost/m) [$/m] Display types
104 MoneyPerMass Money/Mass (cost/kg) [$/kg] Display types
105 MoneyPerDuration Money/Duration (cost/s) [$/s] Display types
106 MoneyPerVolume Money/Volume (cost/m3) [$/m3] Display types

Some of the unit types have a relative and an absolute variant. Relative scalars can be added to or subtracted from relative and absolute scalars; absolute scalars cannot be added, but can be subtracted, resulting in a relative scalar. As an example, one cannot add two times (3-1-2017, 5 o'clock + 3-1-2017, 3 o'clock = ??), but these values can be subtracted (3-1-2017, 5 o'clock – 3-1-2017, 3 o'clock = 2 hours). Absolute plus relative yields e.g., 3-1-2017, 17:00 + 2 hours = 3-1-2017, 19:00. Relative values can of course be added/subtracted: 2 hours + 30 minutes = 2.5 hours. See https://djunits.org for more information.