Template:Unit/doc: Difference between revisions

From Eco - English Wiki
[unchecked revision][unchecked revision]
m (Remove references to sandboxes.)
m (Add to "Formatting templates" category.)
Line 82: Line 82:
*[[Module:Unit]]
*[[Module:Unit]]
{{doc/end}}
{{doc/end}}
<includeonly>[[Category:Formatting templates]]</includeonly>

Revision as of 00:56, 26 February 2022

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