Template:Unit/doc

From Eco - English Wiki
Revision as of 00:56, 26 February 2022 by Demian (talk | contribs) (Add to "Formatting templates" category.)

Template:Doc/start

Add a tooltip to an abbreviation of a unit of measure showing the actual name of the unit.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Unit abbreviationabbr

Case sensitive abbreviation of a unit of measure. If the abbreviation contains a forward slash "/" it may be replaced with the character "p".

Example
m/s, mps, GHz, ppm, kg, m2, kWh
Stringrequired

Usage

{{Unit|abbr}}

New units

Recognized units are defined and documented in Module:Unit/data.

Examples

Commonly used units.
Code Result
{{Unit|ppm}} ppm
{{Unit|m}} m
{{Unit|m/s}} m/s
{{Unit|mps}} m/s
{{Unit|kg}} kg
{{Unit|degc}} °C

Note that the abbreviation is case sensitive and if the unit contains special symbols they are displayed correctly:

Various units.
Code Result
{{Unit|mHz}} mHz
{{Unit|MHz}} MHz
{{Unit|m2}} m2
{{Unit|kohm}}
{{Unit|kWh}} kW⋅h
{{Unit|um}} μm
{{Unit|J/(Kmol)}} J/(K⋅mol)

If a unit definition is not found, the abbreviation (or text) is returned unchanged.

Invalid units.
Code Result
{{Unit|things}} things
{{Unit|something/other}} something/other
{{Unit|players per hour}} players per hour

Modules

This template is using the following Modules:

Template:Doc/end