Add a tooltip to an abbreviation of a unit of measure showing the actual name of the unit.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Number | number | Numerical value to format for display with the unit.
| Number | optional |
Unit abbreviation | abbr | Case sensitive abbreviation of a unit of measure. If the abbreviation contains a forward slash "/" it may be replaced with the character "p".
| String | optional |
Usage
- With a formatted number:
{{Unit|number|abbr}}
- If a number is specified, it is formatted with a space " " as a thousands separator and a period "." as the decimal separator.
- With unit abbreviation only:
{{Unit|abbr}}
New units
Recognized units are defined and documented in Module:Unit/data.
Examples
Code | Result |
---|---|
{{Unit|ppm}} |
ppm |
{{Unit|1200|m}} |
1 200 m |
{{Unit|1|m/s}} |
1 m/s |
{{Unit|mps}} |
m/s |
34 {{Unit|kg}} |
34 kg |
{{Unit|+2|degc}} |
+2 °C |
Note that the abbreviation is case sensitive and if the unit contains special symbols they are displayed correctly:
Code | Result |
---|---|
{{Unit|-2,1|mHz}} |
-2.1 mHz |
{{Unit|-0.1|MHz}} |
-0.1 MHz |
{{Unit|0|m2}} |
0 m2 |
{{Unit|+1|kohm}} |
+1 kΩ |
{{Unit|852001,99|kWh}} |
852 001.99 kW⋅h |
4–8 {{Unit|um}} |
4–8 μm |
{{Unit|J/(Kmol)}} |
J/(K⋅mol) |
If a unit definition is not found, the abbreviation (or text) is returned unchanged.
Code | Result |
---|---|
{{Unit|things}} |
things |
{{Unit|something/other}} |
something/other |
{{Unit|players per hour}} |
players per hour |
{{Unit}} |
ERROR: No value given to Unit template! |
Modules
This template is using the following Modules: