Quantity
Synopsis
struct Quantity : Value {
string unit;
}
See also: Value
The Quantity structure represents either a valid quantity, a null quantity, or an invalid quantity. In case of a valid quantity, the value attribute inherited from the Value type is present, and the unit attribute contains a valid UNECE unit of measure. In case of a null quantity, the value attribute contains the value zero, and the unit attribute contains an empty string. Null quantities may be used if it is known that the quantity is zero but no information about a particular unit of measure is available. An invalid quantity is represented by a missing value attribute and an unit attribute containing an empty string.
unit
This attribute contains the unit of the value inherited from the Value type (§Value). The unit attribute must be empty if the value attribute is missing. If the value attribute exists, the unit attribute must represent a valid UNECE unit of measure, unless the value is zero, in which case the unit attribute may be empty.