Template:Convert/doc: Difference between revisions

From The World of Gotha
Jump to navigation Jump to search
(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...")
 
mNo edit summary
Line 1: Line 1:
<noinclude>{{docsub}}</noinclude>
<noinclude>{{docsub}}</noinclude>
: ''Not to be confused with [[Template:docsub]].''
<div id="shortcut" style="float:right;margin-top:-10px;">
<div id="shortcut" style="float:right;margin-top:-10px;">
{| class="wikitable" style="text-align:center"
{| class="wikitable" style="text-align:center"
Line 25: Line 24:
==Supported units==
==Supported units==
{| class="wikitable" style="text-align:center"
{| class="wikitable" style="text-align:center"
! Unit !! Unit code !! Calculated unit !! Sample default result
! Type !! Unit !! Unit code !! Calculated unit !! Sample default result
|-
|-
| kilometer || km || mile || {{convert|10|km}}
| rowspan="4" | '''Area''' || square kilometer || km2 || square mile || {{convert|10|km2}}
|-
| square mile || sqmi<br />sq mi || square kilometer || {{convert|10|sqmi}}
|-
| square meter || m2 || square feet || {{convert|10|m2}}
|-
| square feet || sqft<br />sq ft || square meter || {{convert|10|sqft}}
|-
| rowspan="5" | '''Length''' || kilometer || km || mile || {{convert|10|km}}
|-
| mile || mi || kilometer || {{convert|10|mi}}
|-
| meter || m || feet || {{convert|10|m}}
|-
| feet || ft || meter || {{convert|10|ft}}
|-
| yard || yd || meter || {{convert|10|yd}}
|-
| rowspan="2" | '''Mass''' || kilogram || kg || pound || {{convert|10|kg}}
|-
| pound || lb || kilogram || {{convert|10|lb}}
|}
|}

Revision as of 04:40, 24 September 2024

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.
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

Type Unit Unit code Calculated unit Sample default result
Area square kilometer km2 square mile 10 km2 (4 sq mi)
square mile sqmi
sq mi
square kilometer 10 sq mi (26 km2)
square meter m2 square feet 10 m2 (108 sq ft)
square feet sqft
sq ft
square meter 10 sq ft (1 m2)
Length kilometer km mile 10 km (6 mi)
mile mi kilometer 10 mi (16 km)
meter m feet 10 m (33 ft)
feet ft meter 10 ft (3 m)
yard yd meter 10 yd (9 m)
Mass kilogram kg pound 10 kg (22 lb)
pound lb kilogram 10 lb (5 kg)