unit_identifier | := |
core_unit_identifier
| mixed_unit_identifier
| long_unit_identifier |
core_unit_identifier | := |
product_unit ("-per-" product_unit)*
| "per-" product_unit ("-per-" product_unit)*
- Examples:
- foot-per-second-per-second
- per-second
- Note: The normalized form will have only one "per"
|
product_unit | := |
single_unit ("-" single_unit)* ("-" pu_single_unit)*
| pu_single_unit ("-" pu_single_unit)*
- Example: foot-pound-force
- Constraint: No pu_single_unit may precede a single unit
|
single_unit | := |
number_prefix? dimensionality_prefix? prefixed_unit
- Examples: square-meter, or 100-square-meter
|
pu_single_unit | := |
“xxx-” single_unit | “x-” single_unit
- Example: xxx-square-knuts (a Harry Potter unit)
- Note: “x-” is only for backwards compatibility
- See Section 6.6 Private-Use Units
|
number_prefix | := |
("1"[0-9]+ | [2-9][0-9]*) "-"
- Examples:
- kilowatt-hour-per-100-kilometer
- gallon-per-100-mile
- per-200-pound
- Note: The number is an integer greater than one.
|
dimensionality_prefix | := |
"square-" | "cubic-" | "pow" ([2-9]|1[0-5]) "-"
- Note: "pow2-" and "pow3-" canonicalize to "square-" and "cubic-"
|
prefixed_unit | |
(prefix)? simple_unit |
prefix | |
si_prefix | binary_prefix |
si_prefix | := |
"deka" | "hecto" | "kilo", …
|
binary_prefix | := |
"kibi", "mebi", …
|
simple_unit | := |
unit_component ("-" unit_component)*
| “em” | “g” | “us” | “hg” | “of”
- Example: gallon-imperial
- Constraint: At least one unit_component must not itself be a simple_unit
- Note: 3 simple units are currently allowed as legacy usage, where a component wouldn’t be a unit_component (eg for “g-force”)
- We will likely deprecate those and add conformant aliases in the future.
- “hg” and “of” are already only in deprecated simple_units.
|
unit_component | := |
[a-z]{3,∞} | “1” “0”{2,3}
- Constraints:
- Cannot be "per", "and", "square", "cubic", "xxx", or "x"; or start with an SI prefix.
- While the syntax allows any number of letters greater than 3, the unit_components need to be distinct if truncated to 8 letters. This allows for possible future support of units in Unicode Locale Identifiers.
- Example: foot
|
mixed_unit_identifier | := |
(single_unit | pu_single_unit) ("-and-" (single_unit | pu_single_unit ))*
|
long_unit_identifier | := |
grouping "-" core_unit_identifier |
grouping | := |
unit_component |
currency_unit | := |
"curr-" [a-z]{3}
- Constraints:
- The first part of the currency_unit is a standard prefix; the second part of the currency unit must be a valid [Unicode currency identifier](tr35.md#UnicodeCurrencyIdentifier). Note: CLDR does not provide conversions for currencies; this is only intended for formatting.
- Examples: curr-eur-per-square-meter, or pound-per-curr-usd
|