Template:Convert/doc

From The World of Gotha
Revision as of 04:00, 24 September 2024 by Jph2 (talk | contribs) (Created page with "<noinclude>{{docsub}}</noinclude> : ''Not to be confused with Template:docsub.'' <div id="shortcut" style="float:right;margin-top:-10px;"> {| class="wikitable" style="text-align:center" |- | <small>Shortcut</small><hr />'''<nowiki>{{</nowiki>cvt<nowiki>}}</nowiki>''' |}</div> The <nowiki>{{</nowiki>convert}} calculates the value of a measurement in one unit from the value of another unit and presents a formatted result. The resul...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
This is a documentation subpage for Template:Convert.
It may contain usage information, categories and other content that is not part of the original template page.
Not to be confused with Template:docsub.
Shortcut
{{cvt}}

The {{convert}} calculates the value of a measurement in one unit from the value of another unit and presents a formatted result. The result can be rounded.

Usage

  • Basic usage: {{convert|1|2}}
  • Full usage: {{convert|1|2|3}}

Parameters

Parameter Description Type Status Notes
1 Measurement value Numeric Required May be formatted or unformatted
2 Measurement unit String Required Use the unit code from supported units below
3 Rounding Numeric Optional Defaults to the nearest integer. Setting a positive number adds decimal places. Setting a negative number rounds to the left of the decimal point (e.g., tens, hundreds, thousands, etc.).

Supported units

Unit Unit code Calculated unit Sample default result
kilometer km mile 10 km (6 mi)