From World Afropedia
Revision as of 17:17, 13 October 2012 by Kofi (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Template documentation[view] [edit] [history] [purge]

Lua error in package.lua at line 80: module 'Module:Transclusion_count/data/C' not found.

Template {{convert}} calculates measurements from one unit (you can enter) to another one, and then presents the results. For example:

{{convert|2|km|mi}} → 2 kilometres (1.2 mi)
{{convert|7|mi|km}} → 7 miles (11 km)

The available units are listed below. Multiple formatting and calculation options are listed below.

Contents

Unit name or symbol (abbreviation): 1 pound or 1 lb?

By default, the first value shows unit name, the second the symbols (= abbreviation). Use |abbr=on/off to change this behaviour:

{{convert|1|lb|kg}} → 1 pound (0.45 kg) (To compare; default: first value shows unit name)
{{convert|1|lb|kg|abbr=on}} → 1 lb (0.45 kg)
{{convert|1|lb|kg|abbr=off}} → 1 pound (0.45 kilograms)
  • |abbr=in toggles the default behaviour (|abbr=out):
{{convert|1|lb|kg|abbr=in}} → 1 lb (0.45 kilograms)

Adjective: a 10-mile distance

Use |adj=on to produce the adjective form. The difference:

{{convert|10|mi|km}} to go → 10 miles (16 km) to go. (To compare, default)
A {{convert|10|mi|km|adj=on}} distance → A 10-mile (16 km) distance. (Adjective form)

Rounding: 100 ft is 30 m or 30.5 m or 30.48 m?

In detail, it is Template:Convert/LoffAoffD=Soff. In practical use, it is common to round the calculated metric number. With that, there are several possibilities.

Default rounding

By default, the conversion result will be rounded either to precision comparable to that of the input value (the number of digits after the decimal point—or the negative of the number of non-significant zeroes before the point—is increased by one if the conversion is a multiplication by a number between 0.02 and 0.2, remains the same if the factor is between 0.2 and 2, is decreased by 1 if it is between 2 and 20, and so on) or to two significant figures, whichever is more precise. An exception to this is rounding temperatures (see below).
Examples of rounding
Input Displays as Note
{{convert|123|ft|m|-1}} 123 feet (40 m)
{{convert|123|ft|m|0}} 123 feet (37 m)
{{convert|123|ft|m|1}} 123 feet (37.5 m)
{{convert|550|ft|m|0}} 550 feet (168 m) Approximate value is 167.64 m
{{convert|550|ft|m}} 550 feet (170 m) Rounds to 170, when approximate value is 167.64 m
{{convert|500|ft|m|0}} 500 feet (152 m) Approximate value is 152.4 m
{{convert|500|ft|m}} 500 feet (150 m) Rounds to 150, when approximate value is 152.4 m

Convert supports four types of rounding:

Round to a given precision: use |precision=

Specify the desired precision with the fourth unnamed parameter (or third unnamed parameter if the "convert to" parameter is omitted; or fifth unnamed parameter if a range is specified; or fourth unnamed parameter again if a range is specified and the "convert to" parameter is omitted; needs to be replaced with a "precision" named parameter). The conversion is rounded off to the nearest power of 110 this number. For instance, if the result is 8621 and the round number is "-2", the result will be 8600. If the result is "234.0283043" and the round number is "0", the result will be 234.

Round to a given number of significant figures: use |sigfig=

To specify the output number to be with n significant figures use |sigfig=<number>:

  • To compare: {{convert|1200|ft|m}} → 1,200 feet (370 m)
  • {{convert|1200|ft|m|sigfig=4}} → 1,200 feet (365.8 m)
  • {{convert|1200|ft|m|sigfig=3}} → 1,200 feet (366 m)
  • {{convert|1200|ft|m|sigfig=2}} → 1,200 feet (370 m)
  • {{convert|1200|ft|m|sigfig=1}} → 1,200 feet (400 m)

Setting |sigfig= is meaningless

  • {{convert|1200|ft|m|sigfig=0}} → 1,200 feet (0 m)

Round to a multiple of 5: 15, 20, 25, ...

Using |round=5 rounds the outcome to a multiple of 5.

{{convert|10|m|ft}} → 10 metres (33 ft)
{{convert|10|m|ft|round=5}} → 10 metres (33 ft)

Similar: using |round=25 rounds the outcome to a multiple of 25.

{{convert|10|m|ft}} → 10 metres (33 ft)
{{convert|10|m|ft|round=25}} → 10 metres (33 ft)
To compare: {{convert|10|m|ft|sigfig=4}} → 10 metres (32.81 ft)

In a range, one can round each value individually to the default. Use |round=each:

{{convert|10 x 200 x 3000|m|ft}}Expression error: Unrecognized word "x". metres (Expression error: Unexpected < operator. ft)
{{convert|10 x 200 x 3000|m|ft|round=each}}Expression error: Unrecognized word "x". metres (Expression error: Unexpected < operator. ft)

Round to a multiple of a given fraction: 2 316 inch

Specify the desired denominator using |frac=<some positive integer>. (Denominator is the below-the-slash number, for example the 3 in 13).

{{convert|5.56|cm|in|frac=16}} → 5.56 centimetres (
ERROR {Convert}: Invalid parameters: 1=5.56 2=(5.56)*0.01 3= 4= 5= 6= with {u}= n= .
             Try using range: {{convert|5.56|(5.56)*0.01|...}} to convert a range of numbers.
)
{{convert|8|cm|in|frac=4}} → 8 centimetres (
ERROR {Convert}: Invalid parameters: 1=8 2=(8)*0.01 3= 4= 5= 6= with {u}= n= .
             Try using range: {{convert|8|(8)*0.01|...}} to convert a range of numbers.
)

The fraction is reduced when possible:

{{convert|8|cm|in|frac=100}} → 8 centimetres (
ERROR {Convert}: Invalid parameters: 1=8 2=(8)*0.01 3= 4= 5= 6= with {u}= n= .
             Try using range: {{convert|8|(8)*0.01|...}} to convert a range of numbers.
)
{{convert|8|cm|in}} → 8 centimetres (
ERROR {Convert}: Invalid parameters: 1=8 2=(8)*0.01 3= 4= 5= 6= with {u}= n= .
             Try using range: {{convert|8|(8)*0.01|...}} to convert a range of numbers.
) (To compare)

Rounding the temperatures °C, °F and K

In temperatures, the conversion will be rounded either to precision comparable to that of the input value or to that which would give three significant figures when expressed in kelvins, whichever is more precise.

{{convert|10|C|F K}}10 °C (Template:Convert/F K)

Note

For a temperature difference, like to convert "A rise of 20 °C", use |C-change=20 &tc.
{{convert|20|C-change|F-change K-change}} → A rise of 20 °C (Template:Convert/F-change K-change)
To compare: "A temperature of 20 °C" would yield: A temperature of 20 °C (Template:Convert/F K)

Into multiple units: 10 °C (Template:Convert/F K)

Separate the multiple output units by a space:

{{convert|10|C|F K}}10 °C (Template:Convert/F K)
{{convert|5|km|mi nmi}} → 5 kilometres (Template:Convert/mi nmi)

Ranges of values

A range: 6 to 17 kg (13 to 37 lb)

Range indicators are entered as the second parameter (between the values). Range separators can be:

Range separators in {{convert}}
Separator Convert Result Notes
- {{convert|3|-|6|ft}} 3–6 feet (0.91–1.8 m) Input can be hyphen (-) or en dash (–), output uses en dashes
- &ndash;(en dash) {{convert|3|–|6|ft}} 3–6 feet (0.91–1.8 m)
and {{convert|3|and|6|ft}} 3 and 6 feet (0.91 and 1.8 m)
and&& {{convert|3|&|6|ft}} Template:Convert/& Same as and
and(-) {{convert|3|and(-)|6|ft}} Template:Convert/and(-) |abbr=on alters the punctuation
and(-)|abbr=on {{convert|3|and(-)|6|ft|abbr=on}} Template:Convert/and(-)
or {{convert|3|or|6|ft}} Template:Convert/or/AoffSoff (0.91 or 1.8 m)
to {{convert|3|to|6|ft}} 3 to 6 feet (0.91 to 1.8 m)
to(-) {{convert|3|to(-)|6|ft}} Template:Convert/to(-) |abbr=on alters the punctuation
to(-)|abbr=on {{convert|3|to(-)|6|ft|abbr=on}} Template:Convert/to(-)
to about {{convert|3|to about|6|ft}} Template:Convert/to about
+/- {{convert|3|+/-|6|ft}} Template:Convert/+/-
+/-± &plusmn; {{convert|3|±|6|ft}} Template:Convert/±
+ {{convert|3|+|6|ft}} Template:Convert/+
, {{convert|3|,|6|ft}} Template:Convert/,
, and {{convert|3|, and|6|ft}} Template:Convert/, and
, or {{convert|3|, or|6|ft}} Template:Convert/, or
by {{convert|3|by|6|ft}} Template:Convert/by/AoffSoff (0.91 by 1.8 m)
x {{convert|3|x|6|ft}} Template:Convert/x/AoffSoff (0.91 × 1.8 m) Scientific notation.
|abbr=on alters the punctuation
× &times; {{convert|3|×|6|ft}} Template:Convert/×
x|abbr=on {{convert|3|x|6|ft|abbr=on}} 3 × 6 ft (0.91 × 1.8 m)
xx |xx| is deprecated. Use |x| instead
* |*| is deprecated. Use |x| instead
to- |to-| is deprecated. Use |to(-)| instead
& |&| is deprecated. Use |and| instead
abbr=mos |abbr=mos is deprecated. Use |x| or |by| instead


Multiple dimensions: 6 × 12 m (20 × 39 ft)

Use "by"
{{convert|6|by|12|ft|m}}Template:Convert/by/AoffSoff (1.8 by 3.7 m)
Use "×" or ""x""
{{convert|6|x|12|m|ft}}Template:Convert/x/AoffSoff (20 × 39 ft)

In science, the formal way is to set |x| and |abbr=on (keeping dimensions right, like in area = x km2):

{{convert|6|x|12|m|ft|abbr=on}} → 6 × 12 m (20 × 39 ft)

About feet, inch in ranges and multiples

While it is possible to enter feet, inch in a simple conversion, this is not possible for ranges:

Words

Spelling of unit name: UK metre or US meter?

Default spelling of units is en-UK. To show en-US spelling, use |sp=us:

{{convert|1|m|ft}} → 1 metre (3.3 ft) -- default
{{convert|1|m|ft|sp=us}} → 1 meter (3.3 ft)

Spell out numbers: ten miles

To write a number in words, use |spell=in:

{{convert|10|mi|m|spell=in}} → 10 miles (16,000 m)

To spell out both in and out values, use |spell=on:

{{convert|10|mi|m|spell=on}} → 10 miles (16,000 m)

To make first letter a capital, use |spell=In, |spell=On

{{convert|10|mi|m|spell=In}} → 10 miles (16,000 m)
{{convert|10|mi|m|spell=On}} → 10 miles (16,000 m)

Remember that the spelling of the units (ft, m) is independently set by |abbr=. To the extreme:

{{convert|10|mi|m|spell=on|abbr=off|sp=us}} → 10 miles (16,000 meters)

Extra words: 4 planted acres

Incomplete section
{{convert|4|acre||adj=pre|planted}}Template:Convert/LoffAoffDbSpreNa

Extra adjective words: A Template:Convert/LoffAoffDoutSmid corridor

{{convert|4|ft|m|adj=mid|-long}} → 10-foot-long (3.0 m)

Plural or singular: 1 inch, 2 inches

The unit symbol is singular always. Depending on the preceding number only, a unit name can be shown plural.

Exception

Entering the unit spelled |foot| forces singular output "foot", whatever the number is.

Grammatical construction: The 18-, 24- and 32-pounder (8, 11 and 15 kg) cannons

This example is from article Fort McHenry:

The American defenders had 18-, 24- and 32-pounder (8, 11 and 15 kg) cannons.

This formatted result is not possible straightforward by using {{convert}}. However, it can be made in three steps.

Step 1: Enter the input numbers and units in {{convert}} just to get the calculated output:
  • had {{convert|18 |, |24 |, |32 |lb |kg |0 }} cannons
→ had Template:Convert/, cannons
The core conversion should look good now. You can save this (or preview).
Step 2: We need the resulting text in plain code in the page, not as a {{convert|...}} template.
For this, add subst: to the template name (for 'substitute') :
  • had {{subst:convert|18 |, |24 |, |32 |lb |kg |0 }} cannons
As a check: the preview result should show the conversion correct, with the numbers still right.
Now save this.
→ had 18, 24, 32 pounds (8, 11, 15 kg) cannons
Step 3: When opening the edit screen again, you'll see that the text is there in code. The template {{convert|...}} itself has disappeared. You can change the text as needed. The edit screen text is:
had 18,&nbsp;24,&nbsp;32 pounds (8,&nbsp;11,&nbsp;15&nbsp;kg) cannons
You can edit this text to add the grammar:
  • had 18-,_24-_and_32-pounder (8,&nbsp;11_and_15&nbsp;kg) cannons
After saving your edit, it shows:
→ "had 18-, 24- and 32-pounder (8, 11 and 15 kg) cannons".

Numbers

Using an SI prefix: gigameter (Gm), or micrometer (μm)

Metric prefixes
Text Symbol Factor
yotta Y 1024
zetta Z 1021
exa E 1018
peta P 1015
tera T 1012
giga G 109
mega M 106
kilo k 103
hecto h 102
deca da 101
(none) (none)  1
deci d 10−1
centi c 10−2
milli m 10−3
micro μ 10−6
nano n 10−9
pico p 10−12
femto f 10−15
atto a 10−18
zepto z 10−21
yocto y 10−24

Units can have an SI prefix like G before the unit: Gm, and giga before the name: gigameter. These are plain multiplication factors.

To illustrate, these are trivial calculations (from meter to meter), showing the multiplication factor:

  • 12 Gm (1.2×1010 m)
  • 12 µm (1.2×10−5 m)

The prefix can be added before the SI unit (here: unit m for meter):

  • {{convert|12|Gm|mi|abbr=on}} → 12 Gm (7,500,000 mi)
  • Mm: 12 Mm (7,500 mi)
  • km: 12 km (39,000 ft)
  • mm: 12 mm (0.47 in)
  • μm: 12 µm (0.012 mm)
  • um: Template:Convert/um (letter "u" can be used for "μ" here)

The prefix can be used in the output unit:

  • {{convert|12000|mi||Mm|abbr=on}} → 12,000 mi (19 Mm)
  • {{convert|12|in|μm|abbr=on}} → 12 in (300,000 µm)

As an exception, the non-SI unit "inch" can have the "μ" prefix too)


Script error: No such module "labelled list hatnote".

Input with fractions: 1+1+2{{{4}}} inches (38.1 mm)

The number to convert can be written in fractions:

{{convert|1/2|in|mm|1}}1+2{{{4}}} inches (12.7 mm)

Also the fraction slash () is accepted:

{{convert|1⁄2|in|mm|1}}Expression error: Unrecognized punctuation character "⁄". inches (Formatting error: invalid input when rounding mm)

With integers, use a + sign

{{convert|2+1⁄2|in|mm|1}}Expression error: Unrecognized punctuation character "⁄". inches (Formatting error: invalid input when rounding mm)

When negative, use a hyphen - and repeat it:

{{convert|-2-1⁄2|in|mm|1}}Expression error: Unrecognized punctuation character "⁄". inches (Formatting error: invalid input when rounding mm)
{{convert|2-1⁄2|in|mm|1}}Expression error: Unrecognized punctuation character "⁄". inches (Formatting error: invalid input when rounding mm) Note: this is read as a range
{{convert|-2+1⁄2|in|mm|1}}Expression error: Unrecognized punctuation character "⁄". inches (Formatting error: invalid input when rounding mm) Red XN Should be a number, not an expression (do not require a calculation)

Engineering notation: 7 × 106 m

Engineering number notations like 7E6 (for 7 × 106) are to be entered as a prefix en to the unit:

{{convert|7|e6m}}Template:Convert/e6m

The same is possible for the output unit:

{{convert|23,000,000|ft|e6m}} → 23,000,000 feet (Template:Convert/e6m)

Any standard unit (not a combination, multiple, or built-in) can have a prefix:

e3 (thousand), e6 (million), e9 (billion), e12 (trillion), e15 (quadrillion).

Thousands separator: 1,000 mi and 1000 mi

In input, a comma for thousands separator is accepted. A gap (space) is not. In output, by default, the thousand separator is the comma:

  • {{convert|1,234,567|m|ft}} → 1,234,567 metres (4,050,417 ft)
  • {{convert|1,234,567|m|ft}} → 1,234,567 metres (4,050,417 ft)
  • {{convert|1 234 567|m|ft}}Expression error: Unexpected number. metres (Expression error: Unexpected < operator. ft) Red XN

Set |comma=off to remove the separator:

Use |comma=gaps to set digit grouping by gap (<space>) in larger numbers (thousands separator):

  • {{convert|1234567|m|ft}} → 1,234,567 metres (4,050,417 ft) (To compare, default)
  • {{convert|1234567|m|ft|comma=gaps}} → 1,234,567 metres (4,050,417 ft)

Setting |comma=5 or |comma=gaps5 will only add the separator when the number of digits is 5 or more:

  • {{convert|1234|m|ft}} → 1,234 metres (4,049 ft) (To compare, default)
  • {{convert|1234|m|ft|comma=5}} → 1,234 metres (4,049 ft)
  • {{convert|1234567|m|ft|comma=5}} → 1,234,567 metres (4,050,417 ft)
  • {{convert|1234|m|ft|comma=gaps5}} → 1,234 metres (4,049 ft)
  • {{convert|1234567|m|ft|comma=gaps5}} → 1,234,567 metres (4,050,417 ft)

Output with horizontal fraction bar in: 1/2 inch

Using a double slash (//) returns a horizontal bar fraction:

  • {{convert|1//2|in|mm|1}}Expression error: Unexpected / operator. inches (Formatting error: invalid input when rounding mm)
  • {{convert|2+1//2|in|mm|1}}Expression error: Unexpected / operator. inches (Formatting error: invalid input when rounding mm)

Output manipulation

Brackets and separators: 10 m [33 ft]

Punctuation that distinguishes the two measurements is set by |disp=.
Options are: b (the default), sqbr, comma, or, br, x|...:

{{convert|10|m|ft}} → 10 metres (33 ft) -- ( ) brackets are the default
{{convert|10|m|ft|disp=sqbr}}Template:Convert/LoffAoffDsqbrSoff
{{convert|10|m|ft|disp=comma}}Template:Convert/LoffAoffDcommaSoff
{{convert|10|m|ft|disp=or}}Template:Convert/LoffAoffDorSoff

Setting |disp=br will force a new line (<br>)

{{convert|10|m|ft|disp=br}}Template:Convert/LoffAoffDbrSoffTemplate:Convert/test/Dbr

Setting |disp=x|... allows any text as separator:

{{convert|10|m|ft|disp=x|_MyText_}}Template:Convert/LoffAoffDxSoff -- (To display spaces, use &nbsp;)

Flipping (reordering) the two measurements: 1 mile (1,609.3 metres)

Setting |order=flip will flip (swap) the two measurements:

{{convert|1|mi|m}} → 1 mile (1,609.3 metres) (To compare, default)
{{convert|1|mi|m|order=flip}} → 1 mile (1,609.3 metres)

When converting to multiple units, the effect is:

{{convert|10|km|mi nmi|order=flip}} → 10 kilometres (Template:Convert/mi nmi)
{{convert|10|km|nmi mi|order=flip}} → 10 kilometres (Template:Convert/multi2LoffAoffSoff)

Displaying parts of the result: Template:Convert/cuyd

It is possible to display only parts of the conversion result:

Convert Output Description
{{convert|2|cuyd|m3}} Template:Convert/cuyd Default, to compare
{{convert|2|cuyd|m3|abbr=values}} Template:Convert/cuyd Input and output numbers
{{convert|2|cuyd|m3|disp=unit}} Template:Convert/cuyd Input unit
{{convert|2|cuyd|m3|disp=unit|adj=on}} Template:Convert/cuyd Input unit, adjective (hyphenated)
{{convert|2|cuyd|cuyd|0|disp=out|abbr=off}} Template:Convert/cuyd Input (workaround)
{{convert|2|cuyd|m3|abbr=~}} Template:Convert/cuydTemplate:Convert/test/A~ Input: both name and symbol
{{convert|2|cuyd|m3|disp=unit2}} Template:Convert/cuyd Output unit (symbol)
{{convert|2|cuyd|m3|disp=unit2|abbr=off}} Template:Convert/cuyd Output unit (name)
{{convert|2|cuyd|m3|disp=number}} Template:Convert/cuyd Output value
{{convert|2|cuyd|m3|disp=out}} Template:Convert/cuyd Output value and unit
{{convert|2|cuyd|m3|disp=out|abbr=off}} Template:Convert/cuyd Output value and unit

Display input name and symbol: 2 kilopascals [kPa]

Setting |abbr=~ returns both name and symbol of the first (input) unit:

{{convert|2|kPa|psi|abbr=~}}Template:Convert/kPaTemplate:Convert/test/A~
A {{convert|2|kPa|psi|abbr=~|adj=on}} pressureA Template:Convert/kPaTemplate:Convert/test/A~ pressure

Table options

For the wikitable structure, there are two options: split over columns and make the table sortable.

Show numbers only in columns in a table

Using {convert} in a table cell, with |disp=table splits the result over two columns:

{{convert|10|m|ft|disp=table}} → align=right|10

|align=right|33

|disp=tablecen does the same, and also centers the text:

{{convert|20|m|ft|disp=tablecen}} → style="text-align:center;"|20

|style="text-align:center;"|66

The units are added as a column header:

  m ft
disp=table 10 33
disp=tablecen 20 66
disp=<other> (default) Template:Convert/LoffAoffDSoff

Sorting

Use both |disp=table |sortable=on to produce table columns (pipe symbols), with sortable table column. As of January 2013, only the first (lefthand) column will sort (improvements pending).
{{convert|10|m|ft|disp=table|sortable=on}} →

7001100000000000000align=right|10 |align=right|33

This shows the hidden numerical sortkey:

align="right"|<span style="display:none">7001100000000000000</span>10 |align="right"|33

m ft
15+3/4 17
15.5 51
16.0 52.5
16 52

Units

The table below lists units supported by template {{convert}}. The list is not complete—more complete lists are linked for each dimension. A complete list is at the full list of units.

The unit-code (column 3), is accepted as input by the template. These can be used as the second or third unnamed parameter. Some units have alternative codes; these are shown in brackets e.g. °F (F): either may be entered for Fahrenheit.

Column 7 lists standard combinations of multiple converted outputs. For example, {{convert|55|nmi|km mi}} produces "55 nautical miles (Template:Convert/km mi)". Such a combination must be used as the third unnamed parameter.

Abridged list of units supported by {{Convert}}
Explanation
system unit unit-
code
symbol or
abbrev.
notes sample default
conversion
combination
output units
the system(s) to which the unit belongs units listed by name unit-code to use in template symbols shown in output other notes about the units sample of the default conversion for the unit output codes for multiple conversions


LENGTH
(Full list)
system unit unit-
code
abbrev-
iation
notes sample default
conversion
combination
output units
SI Template:Convert/LonAoffDunitSoff Mm Template:Convert/LoffAonDunitSoff US spelling: megameter
1.0 Mm (620 mi)
Template:Convert/LonAoffDunitSoff km Template:Convert/LoffAonDunitSoff US spelling: kilometer
1.0 km (0.62 mi)
  • km mi
Template:Convert/LonAoffDunitSoff m Template:Convert/LoffAonDunitSoff US spelling: meter
1.0 m (Template:Convert/ftin)
  • m ft
  • m ftin
Template:Convert/LonAoffDunitSoff cm Template:Convert/LoffAonDunitSoff US spelling: centimeter
1.0 cm (
ERROR {Convert}: Invalid parameters: 1=1.0 2=( 1.0 )*0.01 3= 4= 5= 6= with {u}= n= .
             Try using range: {{convert|1.0|( 1.0 )*0.01|...}} to convert a range of numbers.
)
  • cm in
Template:Convert/LonAoffDunitSoff mm Template:Convert/LoffAonDunitSoff US spelling: millimeter
1.0 mm (0.039 in)
  • mm in
Template:Convert/LonAoffDunitSoff µm (um) Template:Convert/LoffAonDunitSoff US spelling: micrometer
1.0 µm (3.9×10−5 in)
Template:Convert/LonAoffDunitSoff nm Template:Convert/LoffAonDunitSoff US spelling: nanometer
1.0 nm (3.9×10−8 in)
non-SI metric Template:Convert/LonAoffDunitSoff Å
(angstrom)
Template:Convert/LoffAonDunitSoff 1.0 Å (3.9×10−9 in)
Imperial
&
US customary
Template:Convert/LonAoffDunitSoff mi Template:Convert/LoffAonDunitSoff 1.0 mi (1.6 km)
  • mi km
Template:Convert/LonAoffDunitSoffNa furlong Template:Convert/LoffAonDunitSoffNa Template:Convert/LonAonDbSoffNa
Template:Convert/LonAoffDunitSoffNa chain Template:Convert/LoffAonDunitSoffNa Template:Convert/LonAonDbSoffNa
Template:Convert/LonAoffDunitSoff rd Template:Convert/LoffAonDunitSoff For other names of this unit see the full list. 1.0 rd (Template:Convert/ft m)
Template:Convert/LonAoffDunitSoffNa fathom Template:Convert/LoffAonDunitSoffNa fathom ≡ 6 ft Template:Convert/LonAonDbSoffNa
Template:Convert/LonAoffDunitSoff yd Template:Convert/LoffAonDunitSoff assumes the international definition 1.0 yd (0.91 m)
Template:Convert/LonAoffDunitSoff ft (foot) Template:Convert/LoffAonDunitSoff long code "foot" outputs foot (and never feet) 1.0 ft (0.30 m)
  • ftin (feet and inches)
  • ft m (foot m)
Template:Convert/LonAoffDunitSoff in Template:Convert/LoffAonDunitSoff 1.0 in (25 mm)
  • in cm
  • in mm
Other Template:Convert/LonAoffDunitSoff nmi Template:Convert/LoffAonDunitSoff the international standard nautical mile
For other nautical miles see the full list.
1.0 nmi (Template:Convert/km mi)
Template:Convert/LonAoffDunitSoff pc Template:Convert/LoffAonDunitSoff 1.0 pc (3.3 ly)
Template:Convert/LonAoffDunitSoff ly Template:Convert/LoffAonDunitSoff 1.0 ly (63,000 AU)
Template:Convert/LonAoffDunitSoff AU Template:Convert/LoffAonDunitSoff 1.0 AU (Template:Convert/km mi)


AREA
(Full list)
system unit unit-
code
abbrev-
iation
notes sample default
conversion
combination
output units
SI Template:Convert/LonAoffDunitSoff km2 Template:Convert/LoffAonDunitSoff US spelling: square kilometer
1.0 km2 (0.39 sq mi)
  • km2 sqmi
Template:Convert/LonAoffDunitSoff m2 Template:Convert/LoffAonDunitSoff US spelling: square meter
1.0 m2 (11 sq ft)
  • m2 sqft
Template:Convert/cm2 cm2 (none) US spelling: square centimeter
Template:Convert/cm2
  • cm2 sqin
Template:Convert/mm2 mm2 (none) US spelling: square millimeter
Template:Convert/mm2
  • mm2 sqin
non-SI metric Template:Convert/LonAoffDunitSoff ha Template:Convert/LoffAonDunitSoff 1.0 ha (2.5 acres)
Imperial
&
US customary
Template:Convert/LonAoffDunitSoff sqmi Template:Convert/LoffAonDunitSoff 1.0 sq mi (2.6 km2)
  • sqmi km2
Template:Convert/LonAoffDunitSoffNa acre Template:Convert/LoffAonDunitSoffNa Template:Convert/LonAonDbSoffNa
Template:Convert/sqyd sqyd (none) Template:Convert/sqyd
Template:Convert/LonAoffDunitSoff sqft
(sqfoot)
Template:Convert/LoffAonDunitSoff long code "sqfoot" outputs square foot (and never feet) 1.0 sq ft (0.093 m2)
  • sqft m2 (sqfoot m2)
Template:Convert/sqin sqin (none) Template:Convert/sqin
  • sqin cm2
Other Template:Convert/sqnmi sqnmi (none) Template:Convert/sqnmi
Template:Convert/dunam dunam (none) For alternative spellings and definitions see the full list Template:Convert/dunam
Template:Convert/tsubo tsubo (none) Template:Convert/tsubo


VOLUME
(Full list)
system unit unit-
code
abbrev-
iation
notes sample default
conversion
combination
output units
SI Template:Convert/LonAoffDunitSoff m3 Template:Convert/LoffAonDunitSoff US spelling: cubic meter
one kilolitre
1.0 m3 (Template:Convert/cuft)
Template:Convert/cm3 cm3 (none) US spelling: cubic centimeter
one millilitre
Template:Convert/cm3
cc Template:Convert/LoffAonDunitSoff
Template:Convert/mm3 mm3 (none) US spelling: cubic millimeter
Template:Convert/mm3
non-SI metric Template:Convert/LonAoffDunitSoff kl Template:Convert/LoffAonDunitSoff US spelling: kiloliter
one cubic metre
1.0 kl (Template:Convert/cuft)
kL Template:Convert/kL
Template:Convert/LonAoffDunitSoff l Template:Convert/LoffAonDunitSoff US spelling: liter
one cubic decimetre
Allows triple output units. See: full list.
1.0 l (Template:Convert/impgal usgal)
  • l impgal
  • l USgal
  • l U.S.gal
  • l USdrygal
  • l U.S.drygal
L Template:Convert/L
  • L impgal
  • L impqt
  • L USgal
  • L U.S.gal
  • L USdrygal
  • L U.S.drygal
Template:Convert/cl cl (none) US spelling: centiliter
Template:Convert/cl
cL Template:Convert/cL
Template:Convert/ml ml (none) US spelling: milliliter
one cubic centimetre
Template:Convert/ml
  • ml impoz
  • ml USoz
  • ml U.S.oz
mL Template:Convert/mL
  • mL impoz
  • mL USoz
  • mL U.S.oz
Imperial
&
US customary
Template:Convert/cuyd cuyd (none) Template:Convert/cuyd
Template:Convert/cuft cuft (cufoot) (none) long code "cufoot" outputs cubic foot (and never feet) Template:Convert/cuft
Template:Convert/LonAoffDunitSoff cuin Template:Convert/LoffAonDunitSoff 1.0 cu in (Template:Convert/cm3)
Imperial Template:Convert/impbbl impbbl (none) 36 imp gal Template:Convert/impbbl
Template:Convert/impbsh impbsh (none) 8 imp gal Template:Convert/impbsh
impbu Template:Convert/impbu
Template:Convert/impgal impgal (none) 4.54609 litres by definition, also
4 imp qt or 8 imp pt or 160 imp fl oz
Allows triple output units. See: full list.
Template:Convert/impgal
  • impgal l
  • impgal L
  • impgal USgal
  • impgal U.S.gal
  • impgal USdrygal
  • impgal U.S.drygal
Template:Convert/impqt impqt (none) 1/4 imp gal or 40 imp fl oz Template:Convert/impqt
Template:Convert/imppt imppt (none) 1/8 imp gal or 20 imp fl oz Template:Convert/imppt
Template:Convert/impoz impoz (impfloz) (none) 1/160 imp gal Template:Convert/impoz
  • impoz USoz
  • impoz U.S.oz
  • impoz ml
  • impoz mL
US customary
liquid measure
Template:Convert/USbbl USbbl (none) 31½ US gal
used for liquids except for oil and beer (see the full list)
Template:Convert/USbbl
U.S.bbl Template:Convert/U.S.bbl
Template:Convert/LonAoffDunitSoff oilbbl Template:Convert/LoffAonDunitSoff 42 US gal 1.0 bbl (0.16 m3)
Template:Convert/USbeerbbl USbeerbbl
(usbeerbbl)
(none) Template:Convert/USbeerbbl
U.S.beerbbl
(usbeerbbl)
Template:Convert/U.S.beerbbl
Template:Convert/LonAoffDunitSoff USgal Template:Convert/LoffAonDunitSoff 231 cubic inches by definition, also
4 US qt or 8 US pt or 128 US fl oz
Allows triple output units. See: full list.
1.0 US gal (Template:Convert/l impgal)
  • USgal l
  • USgal L
  • USgal impgal
U.S.gal Template:Convert/U.S.gal
  • USgal l
  • USgal L
  • USgal impgal
Template:Convert/USqt USqt (none) 1/4 US gal or 32 US fl oz Template:Convert/USqt
U.S.qt Template:Convert/U.S.qt
Template:Convert/USpt USpt (none) 1/8 US gal or 16 US fl oz Template:Convert/USpt
U.S.pt Template:Convert/U.S.pt
Template:Convert/USoz USoz
(USfloz)
(none) 1/128 US gal Template:Convert/USoz
  • USoz ml
  • USoz mL
  • USoz impoz
U.S.oz
(U.S.floz)
Template:Convert/U.S.oz
  • U.S.oz ml
  • U.S.oz mL
  • U.S.oz impoz
US customary
dry measure
Template:Convert/USdrybbl USdrybbl (none) 105/32 US bsh Template:Convert/USdrybbl
U.S.drybbl Template:Convert/U.S.drybbl
Template:Convert/USbsh USbsh (none) 2150.42 cubic inches by definition Template:Convert/USbsh
U.S.bsh Template:Convert/U.S.bsh
Template:Convert/USbu USbu (none) 2150.42 cubic inches by definition Template:Convert/USbu
U.S.bu Template:Convert/U.S.bu
Template:Convert/USdrygal USdrygal (none) 1/8 US bsh
Allows triple output units. See: full list.
Template:Convert/USdrygal
  • USdrygal l
  • USdrygal L
  • USdrygal impgal
U.S.drygal Template:Convert/U.S.drygal
  • U.S.drygal l
  • U.S.drygal L
  • U.S.drygal impgal
Template:Convert/USdryqt USdryqt (none) 1/32 US bsh Template:Convert/USdryqt
U.S.dryqt Template:Convert/U.S.dryqt
Template:Convert/USdrypt USdrypt (none) 1/32 US bsh Template:Convert/USdrypt
U.S.drypt Template:Convert/U.S.drypt


SPEED
(Full list)
system unit unit-
code
abbrev-
iation
notes sample default
conversion
combination
output units
SI Template:Convert/m/s m/s (none) US spelling: meter per second
Template:Convert/m/s
  • m/s ft/s (m/s foot/s)
non-SI metric Template:Convert/LonAoffDunitSoff km/h Template:Convert/LoffAonDunitSoff US spelling: kilometer per hour
1.0 km/h (0.62 mph)
  • km/h mph
Imperial
&
US customary
Template:Convert/LonAoffDunitSoff mph Template:Convert/LoffAonDunitSoff 1.0 mph (1.6 km/h)
  • mph km/h
  • mph kn
Template:Convert/ft/s ft/s (foot/s) (none) long code "foot/s" outputs foot per second (and never feet) Template:Convert/ft/s
  • ft/s m/s
Maritime units Template:Convert/kn kn (knot) (none) Template:Convert/kn
  • kn mph


FORCE
(Full list)
system unit unit-
code
abbrev-
iation
notes sample default
conversion
combination
output units
SI Template:Convert/GN GN (none) Allows triple output units. See: full list. Template:Convert/GN
  • GN LT-f
  • GN LTf
  • GN ST-f
  • GN STf
Template:Convert/MN MN (none) Allows triple output units. See: full list. Template:Convert/MN
  • MN LT-f
  • MN LTf
  • MN ST-f
  • MN STf
Template:Convert/kN kN (none) Allows triple output units. See: full list. Template:Convert/kN
  • kN LT-f
  • kN LTf
  • kN ST-f
  • kN STf
Template:Convert/N N (none) Template:Convert/N
  • N lb-f
  • N lbf
  • N oz-f
  • N ozf
Template:Convert/mN mN (none) Template:Convert/mN
  • mN oz-f
  • mN ozf
  • mN gr-f
  • mN grf
Template:Convert/µN µN (uN) (none) Template:Convert/µN
  • µN gr-f
  • µN grf
Template:Convert/nN nN (none) Template:Convert/nN
  • nN gr-f
  • nN grf
cgs Template:Convert/Mdyn Mdyn (none) Template:Convert/Mdyn
Template:Convert/kdyn kdyn (none) Template:Convert/kdyn
Template:Convert/dyn dyn
(dyne)
(none) Template:Convert/dyn
Template:Convert/mdyn mdyn (none) Template:Convert/mdyn
Metric gravitational units Template:Convert/t-f t-f (none) Template:Convert/t-f
tf Template:Convert/tf
Template:Convert/kg-f kg-f (none) Template:Convert/kg-f
kgf Template:Convert/kgf
Template:Convert/g-f g-f (none) Template:Convert/g-f
gf Template:Convert/gf
Template:Convert/mg-f mg-f (none) Template:Convert/mg-f
mgf Template:Convert/mgf
Avoirdupois-based units Template:Convert/pdl pdl (none) Template:Convert/pdl
Template:Convert/LT-f LT-f (none) Template:Convert/LT-f
  • LT-f ST-f
LTf Template:Convert/LTf
  • LTf STf
Template:Convert/ST-f ST-f (none) Template:Convert/ST-f
  • ST-f LT-f
STf Template:Convert/STf
  • STf LTf
Template:Convert/lb-f lb-f (none) Template:Convert/lb-f
lbf Template:Convert/lbf
Template:Convert/gr-f gr-f (none) Template:Convert/gr-f
grf Template:Convert/grf


ENERGY
(Full list)
system unit unit-
code
abbrev-
iation
notes sample default
conversion
combination
output units
SI Template:Convert/GJ GJ (none) Template:Convert/GJ
Template:Convert/MJ MJ (none) Template:Convert/MJ
Template:Convert/LonAoffDunitSoff kJ Template:Convert/LoffAonDunitSoff 1.0 kJ (Template:Convert/cal)
Template:Convert/hJ hJ (none) Template:Convert/hJ
Template:Convert/daJ daJ (none) Template:Convert/daJ
Template:Convert/J J (none) Template:Convert/J
Template:Convert/dJ dJ (none) Template:Convert/dJ
Template:Convert/cJ cJ (none) Template:Convert/cJ
Template:Convert/mJ mJ (none) Template:Convert/mJ
Template:Convert/µJ µJ (uJ) (none) Template:Convert/µJ
Template:Convert/nJ nJ (none) Template:Convert/nJ
cgs Template:Convert/Merg Merg (none) Template:Convert/Merg
Template:Convert/kerg kerg (none) Template:Convert/kerg
Template:Convert/erg erg (none) Template:Convert/erg
Watt-hour multiples Template:Convert/LonAoffDunitSoff TWh Template:Convert/LoffAonDunitSoff 1.0 TWh (Template:Convert/PJ)
TW.h Template:Convert/TW.h
Template:Convert/GWh GWh (none) Template:Convert/GWh
GW.h Template:Convert/GW.h
Template:Convert/MWh MWh (none) Template:Convert/MWh
MW.h Template:Convert/MW.h
Template:Convert/kWh kWh (none) Template:Convert/kWh
kW.h Template:Convert/kW.h
Template:Convert/Wh Wh (none) Template:Convert/Wh
W.h Template:Convert/W.h
Electron-
volt
multiples
Template:Convert/GeV GeV (none) Template:Convert/GeV
Template:Convert/MeV MeV (none) Template:Convert/MeV
Template:Convert/keV keV (none) Template:Convert/keV
Template:Convert/eV eV (none) Template:Convert/eV
Template:Convert/meV meV (none) Template:Convert/meV
Calorie multiples Template:Convert/Cal Cal (none) The thermo-chemical calorie is the default definition. For others, see the full list. Template:Convert/Cal
Template:Convert/Mcal Mcal (none) Template:Convert/Mcal
Template:Convert/LonAoffDunitSoff kcal Template:Convert/LoffAonDunitSoff 1.0 kcal (4.2 kJ)
Template:Convert/cal cal (none) Template:Convert/cal
Template:Convert/mcal mcal (none) Template:Convert/mcal
pound/
ounce
-foot/
inch-hour-minute-second
Template:Convert/ftpdl ftpdl (none) Template:Convert/ftpdl
Template:Convert/ftlbf ftlbf (none) Template:Convert/ftlbf
ftlb-f Template:Convert/ftlb-f
Template:Convert/inlbf inlbf (none) Template:Convert/inlbf
inlb-f Template:Convert/inlb-f
Template:Convert/inozf inozf (none) Template:Convert/inozf
inoz-f Template:Convert/inoz-f
Template:Convert/hph hph (none) Template:Convert/hph
British thermal unit Template:Convert/Btu Btu (none) The International Steam Table British thermal unit is used. For others, see the full list. Template:Convert/Btu
BTU Template:Convert/BTU
TNT-based units Template:Convert/GtTNT GtTNT (none) Template:Convert/GtTNT
Template:Convert/GtonTNT GtonTNT (none)
Template:Convert/MtTNT MtTNT (none) Template:Convert/MtTNT
Template:Convert/MtonTNT MtonTNT (none)
Template:Convert/ktTNT ktTNT (none) Template:Convert/ktTNT
Template:Convert/ktonTNT ktonTNT (none)
Template:Convert/tTNT tTNT (none) Template:Convert/tTNT
Template:Convert/tonTNT tonTNT (none)
Other
Template:Convert/Eh Eh (none) Template:Convert/Eh
Template:Convert/Ry Ry (none) Template:Convert/Ry
Template:Convert/toe toe (none) Template:Convert/toe
Template:Convert/BOE BOE (none) Template:Convert/BOE
cubic foot of natural gas cuftnaturalgas (cufootnaturalgas) Unit-code cufootnaturalgas will show "cubic foot of natural gas" if plural. Template:Convert/cuftnaturalgas
Template:Convert/latm latm (none) Template:Convert/latm
Latm Template:Convert/Latm
Template:Convert/impgalatm impgalatm (none) Template:Convert/impgalatm
Template:Convert/USgalatm USgalatm
(usgalatm)
(none) Template:Convert/USgalatm
U.S.galatm
(usgalatm)
Template:Convert/U.S.galatm


TEMPERATURE
(Full list)
system unit unit-
code
abbrev-
iation
notes sample default
conversion
combination
output units
SI Template:Convert/K K (none) Allows triple output units. See: full list. Template:Convert/K
  • K °C (K C)
  • K °R (K R)
  • K °F (K F)
Template:Convert/LonAoffDunitSoffT °C (C) Template:Convert/LoffAonDunitSoffT Template:Convert/LonAonDbSoffT
  • °C K (C K)
  • °C °R (C R)
  • °C °F (C F)
Imperial
&
US customary
Template:Convert/°R °R (R) (none) Template:Convert/°R
  • °R K (R K)
  • °R °C (R C)
  • °R °F (R F)
Template:Convert/LonAoffDunitSoffT °F (F) Template:Convert/LoffAonDunitSoffT Template:Convert/LonAonDbSoffT
  • °F K (F K)
  • °F °C (F C)
  • °F °R (F R)
Celsius change C-change Used for temperature intervals instead of actual temperatures
Example:  {{convert|5|C-change|0}} warmer
Result: 5 °C (9 °F) warmer
Fahrenheit change F-change Used for temperature intervals instead of actual temperatures
Example:  {{convert|10|F-change|0}} colder
Result: 10 °F (6 °C) colder


MASS
(Full list)
system unit unit-
code
abbrev-
iation
notes sample default
conversion
combination
output units
SI Template:Convert/LonAoffDunitSoff kg Template:Convert/LoffAonDunitSoff Allows triple output units. See: full list. 1.0 kg (2.2 lb)
  • kg lb
  • kg st
Template:Convert/LonAoffDunitSoff g Template:Convert/LoffAonDunitSoff 1.0 g (0.035 oz)
  • g oz
Template:Convert/mg mg (none) Template:Convert/mg
  • mg gr
Template:Convert/µg µg (ug) (none) Template:Convert/µg
non-SI metric Template:Convert/LonAoffDunitSoff t Template:Convert/LoffAonDunitSoff Allows triple output units. See: full list. 1.0 t (0.98 LT; 1.1 ST)
  • t LT
  • t ST
Template:Convert/MT MT (none)
  • MT LT
  • MT ST
Avoirdupois Template:Convert/LT LT (none) 2,240 lb
used mostly in the British Commonwealth.
Allows triple output units. See: full list.
Template:Convert/LT
  • LT t
  • LT MT
  • LT ST
long ton Template:Convert/long ton
Template:Convert/ST ST (none) 2,000 lb
used mostly in the US.
Allows triple output units. See: full list.
Template:Convert/ST
  • ST t
  • ST MT
  • ST LT
short ton Template:Convert/short ton
Template:Convert/st st (none) 14 lb
used mostly in the British Commonwealth except Canada.
Allows triple output units. See: full list.
Template:Convert/st
  • st kg
  • st lb
Template:Convert/LonAoffDunitSoff lb Template:Convert/LoffAonDunitSoff Allows triple output units. See: full list. 1.0 lb (0.45 kg)
  • lb kg
  • lb st
Template:Convert/LonAoffDunitSoff oz Template:Convert/LoffAonDunitSoff 1.0 oz (28 g)
  • oz g
Template:Convert/drachm drachm (none) Template:Convert/drachm
Template:Convert/dram dram (none)
Template:Convert/gr gr (none) equivalent to the troy grain Template:Convert/gr
Troy Template:Convert/ozt ozt (none) Template:Convert/ozt
other Template:Convert/carat carat (none) Template:Convert/carat


TORQUE
(Full list)
system unit unit-
code
abbrev-
iation
notes sample default
conversion
combination
output units
Industrial
SI Template:Convert/Nm Nm (none) Triple combinations are also possible. See the full list. Template:Convert/Nm
  • Nm kg.m
  • Nm lb.ft
Non-SI metric Template:Convert/kg.m kg.m (none) Template:Convert/kg.m
  • kg.m Nm
  • kg.m lb.ft
Imperial
&
US customary
Template:Convert/lb.ft lb.ft (none) Template:Convert/lb.ft
  • lb.ft Nm
  • lb.ft kg-m
Scientific
SI Template:Convert/N.m N.m (none) Triple combinations are also possible. See the full list. Template:Convert/N.m
  • N.m kgf.m
  • N.m lbf.ft
Non-SI metric Template:Convert/kgf.m kgf.m (none) Template:Convert/kgf.m
  • kgf.m N.m
  • kgf.m lbf.ft
Imperial
&
US customary
Template:Convert/lbf.ft lbf.ft (none) Template:Convert/lbf.ft
  • lbf.ft N.m
  • lbf.ft kgf.m
DENSITY
(Full list)
system unit unit-
code
abbrev-
iation
notes sample default
conversion
combination
output units
Metric Template:Convert/kg/m3 kg/m3 (none) Template:Convert/kg/m3
  • kg/m3 lb/ft3 (kg/m3 lb/cuft)
  • kg/m3 lb/yd3 (kg/m3 lb/cuyd)
Template:Convert/g/m3 g/m3 (none) Template:Convert/g/m3
  • g/m3 kg/m3
  • g/m3 lb/ft3 (g/cm3 lb/cuft)
  • g/m3 lb/yd3 (g/cm3 lb/cuyd)
Imperial
&
US customary
Template:Convert/lb/ft3 lb/ft3 (none) Template:Convert/lb/ft3
  • lb/ft3 kg/m3 (lb/cu ft g/m3)
  • lb/ft3 g/m3 (lb/cu ft g/m3)
Template:Convert/lb/yd3 lb/yd3 (none) Template:Convert/lb/yd3
  • lb/yd3 kg/m3 (lb/cuyd kg/m3)
  • lb/yd3 g/m3 (lb/cuyd g/m3)


PRESSURE
unit unit-
code
abbrev-
iation
sample default
conversion
Template:Convert/GPa GPa (none) Template:Convert/GPa
Template:Convert/MPa MPa (none) Template:Convert/MPa
Template:Convert/kPa kPa (none) Template:Convert/kPa
Template:Convert/hPa hPa (none) Template:Convert/hPa
Template:Convert/Pa Pa (none) Template:Convert/Pa
Template:Convert/mPa mPa (none) Template:Convert/mPa
Template:Convert/mbar mbar (none) Template:Convert/mbar
mb Template:Convert/mb
Template:Convert/dbar dbar (none) Template:Convert/dbar
Template:Convert/bar bar (none) Template:Convert/bar
Template:Convert/kBa kBa (none) Template:Convert/kBa
Template:Convert/Ba Ba (none) Template:Convert/Ba
Template:Convert/atm atm (none) Template:Convert/atm
Template:Convert/Torr Torr (none) Template:Convert/Torr
Template:Convert/mmHg mmHg (none) Template:Convert/mmHg
Template:Convert/inHg inHg (none) Template:Convert/inHg
Template:Convert/psi psi (none) Template:Convert/psi
FUEL EFFICIENCY
unit unit-
code
notes combinations
kilometres per litre km/l (km/L) Use km/L to get "km/L"
  • km/l mpgimp
  • km/l mpgus
litres per 100 kilometres l/100 km (L/100 km) Use L/100 km to get "L/100 km"
  • l/100 km mpgimp
  • l/100 km mpgus
litres per kilometre l/km (L/km) Use L/km to get "L/km"
  • l/km impgal/mi
  • l/km usgal/mi
miles per imperial gallon mpgimp
  • mpgimp mpgus
miles per US gallon mpgus (mpgUS, mpgU.S.) Use mpgUS to get "US"

Use mpgU.S. to get "U.S."
mpgus will give "U.S." if spelling is
set to US & "US" otherwise

  • mpgus mpgimp
imperial gallons per mile impgal/mi
  • impgal/mi
US gallons per mile usgal/mi (USgal/mi, U.S.gal/mi) As above with the us vs US vs U.S.
  • usgal/mi
The mpgUS, mpgU.S., USgal/mi vs U.S.gal/mi, km/L, L/100 km and L/km variants work within combinations also (making 36 combinations in total).
POWER
Watts, kilowatts, milliwatts, etc. are supported. As is horsepower (English & metric). Use standard abbreviations as input code (lowercase hp for horsepower, for example)
POPULATION DENSITY
unit unit-
code
notes combinations
inhabitants per square kilometre PD/sqkm PD stands for population density, i.e. humans (inhabitants)
  • PD/sqkm PD/sqmi
per square kilometre /sqkm Used when the word 'inhabitants' would be inappropriate.
  • /sqkm /sqmi
inhabitants per hectare PD/ha
  • PD/ha PD/acre
per hectare /ha
  • /ha /acre
inhabitants per square mile PD/sqmi PD stands for population density, i.e. humans (inhabitants)
  • PD/sqmi PD/sqkm
per square mile /sqmi Used when the word 'inhabitants' would be inappropriate.
  • /sqmi /sqkm
inhabitants per acre PD/acre
  • PD/acre PD/ha
per acre /acre
  • /acre /ha
COST PER UNIT MASS
unit unit-
code
notes combinations
dollars per pound $/lb "$" can mean US$, HK$, etc.
  • (none)
dollars per kilogram $/kg
  • (none)
dollars per troy ounce $/ozt 12 troy ounces in 1 troy pound
  • (none)

Parameter list

Parameter options for {{convert}}
Option =.. Description Note
abbr=in in Use symbol for first (left-hand side) unit Symbol ('abbreviation')
abbr=off off Use name for all units Symbol ('abbreviation')
abbr=none none
abbr=on on Use symbol for all units Symbol ('abbreviation')
abbr=out out Use symbol for right-hand side unit (default) Symbol ('abbreviation')
abbr=values values Show only input and output numbers, not units Parts only
abbr=~ ~ Shows both unit name and symbol Symbol & name
adj=j j Join number and unit name using "&nbsp;" instead of a space Join values
adj=mid|x=... mid User-specified text after the input unit; sets adj=on (adjective) Word adding, adjective
adj=on on Unit name is adjective (singular and hyphenated) Grammar, adjective
adj=pre|x=... pre User-specified text before input unit Word adding
adj=ri0 ri0 Round input with precision 0 Rounding and sigfig
adj=ri1 ri1 Round input with precision 1 Rounding and sigfig
adj=ri2 ri2 Round input with precision 2 Rounding and sigfig
adj=ri3 ri3 Round input with precision 3 Rounding and sigfig
disp=b b Join input and output using " (...)" (default) Join values
disp=sqbr sqbr Join input and output using " [...]" Join values
disp=br br Join input and output using "<br/>" Join values
disp=comma comma Join input and output using ", " Join values
disp=or or Join input and output using " or " Join values
disp=number number Display output number only Parts only
disp=output number only output number only
disp=out out Display only output number and name/symbol Parts only
disp=output only output only
disp=preunit|x=... preunit User-specified text before input and output units Word adding
disp=table table Output is suitable for a table cell with align="right" Table columns
disp=tablecen tablecen Output is suitable for a table cell with align="center" Table columns
disp=unit unit Display input name/symbol only ( not input number, not output) Parts only
disp=unit2 unit2 Display output name/symbol only (not input; not output number) Parts only
disp=x|... x Join input and output using user-specified text Word adding
comma=5 05 Only use comma for thousands separator if 5 or more digits Number format
comma=gaps gaps Use gaps (space), not comma, for thousands separator Number format
comma=gaps5 gaps5 Use gaps (space), but only if 5 or more digits Number format
comma=off off No thousands separator Number format
frac=N N Show imperial number in fractions, denominator=N Number format, fraction
lk=in in Link left-hand side unit name or symbol Unit link
lk=on on Link all unit names or symbols (but not twice for the same unit) Unit link
lk=out out Link right-hand side unit name or symbol Unit link
order=flip flip Inverts order of input, output measurements (conversion first) Order
round=5 05 Rounds calculation to the nearest multiple of 5 Rounding and sigfig
round=25 25 Rounds calculation to the nearest multiple of 25 Rounding and sigfig
round=each each In a range, each number is rounded by the default rounding Rounding and sigfig
sigfig=N N Round output number to N significant figures (N is a positive integer) Rounding and sigfig
sortable=in in Output numeric hidden sort field for use in a sortable table (based on input) Table sort
sortable=on on
sortable=out out Output numeric hidden sort field for use in a sortable table (based on output) Table sort
sp=us us Use U.S. spelling (like "meter" instead of default "metre") Spelling U.S. names
spell=in in Spell input number in words Spelling numbers
spell=In In Spell input number in words with first letter uppercase Spelling numbers
spell=on on Spell input and output numbers in words Spelling numbers
spell=On On Spell input and output numbers in words with first letter uppercase Spelling numbers
$= $ Replace $-sign with a currency sign, for example in $/acre (no currency conversion happens) Cost per unit
debug=yes yes Debugging only. In a sortable table: show the normally hidden sort key Table sort
abbr=comma comma Deprecated. Use |comma=off Number format
abbr=mos mos Deprecated. Use |x| or |by| Range format
adj=1 01 Deprecated. Do not use. No need to deviate from MOS regarding plurals Plural or singular
adj=flip flip Deprecated. Use |order=flip Order
adj=nocomma nocomma Deprecated. Use |comma=off Number format
disp=2 02 Deprecated. Use |disp=output only Parts only
disp=5 05 Deprecated. Use |round=5 Rounding and sigfig
disp=flip flip Deprecated. Use |order=flip Order
disp=flip5 flip5 Deprecated. Use |order=flip |round=5 Order, rounding
disp=nocomma nocomma Deprecated. Use |comma=off Number format
disp=u2 u2 Deprecated. Use |disp=unit2 Parts only
near=5 05 Deprecated. Use |round=5 Rounding and sigfig

Deprecated options

This list: view · talk · edit

Deprecated options should not be used. They may produce incorrect or undesired results and there is no guarantee that they will be supported in the future.

  • abbr=comma is deprecated. Use comma=off instead
  • abbr=mos, setting range separators, is deprecated (not MOS compliant). Use |by| or |x| instead
  • adj=1 is deprecated. No need to deviate from MOS regarding plurals
  • adj=flip is deprecated. Use order=flip instead
  • adj=nocomma is deprecated. Use comma=off instead
  • disp=2 is deprecated. Use disp=output only instead
  • disp=5 is deprecated. Use round=5 instead
  • disp=flip is deprecated. Use order=flip instead
  • disp=flip5 is deprecated. Use |order=flip |round=5 instead
  • disp=nocomma is depreated. Use comma=off instead
  • disp=slash, disp=s, disp=/ are deprecated. Use disp=or instead
  • disp=u2 is deprecated. Use disp=unit2 instead
  • near=5 is deprecated. Use round=5 instead
  • Range separator |xx| is deprecated (not MOS compliant). Use |x| instead
  • Range separator |*| is deprecated (not MOS compliant). Use |x| instead
  • Range separator |&| is deprecated. Use |and| instead
  • Range separator |to-| is deprecated. Use |to(-)| instead

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly error report for this template.

TemplateData for Convert

<templatedata>{ "description": "Converts measurements to other units.", "params": { "1": {

 "label": "value",
 "description": "the value to convert",
 "type": "number"

}, "2": {

 "label": "from unit",
 "description": "",
 "type": "string/line"

}, "3": {

 "label": "to units",
 "description": "the unit to convert into",
 "type": "string/line"

}, "4": {

 "label": "precision or suffix",
 "description": "significant digits after decimal dot or, if negative, exponent of ten",
 "type": "number"

}, "lk": {

 "label": "link units",
 "description": "“on” all, “in” input, “out” output or “off” no units",
 "default": "off",
 "type": "string/line"

}, "abbr": {

 "label": "abbreviation",
 "description": "display for the units: “on” unit symbols, “off” all unit names in full words, “in” input unit symbol, “out” abbreviated output units, “values” no units at all",
 "default": "out",
 "type": "string/line"

}, "sp": {

 "label": "spelling",
 "description": "“us” display U.S. spelling of unit names",
 "type": "string/line"

}, "adj": {

 "label": "adjective",
 "description": "adjective form (singular unit name appended by hyphen) “on” or “mid” to put conversion at end",
 "type": "string/line"

}, "disp": {

 "label": "conversion",
 "description": "display conversion result: “or” after ‘or’, “x” with custom prefix and suffix, “b” in parentheses, “table”/“tablecen”, “output only” alone, “output number only” alone and without unit, “unit” not at all but input unit; if the value is a number it is used as precision",
 "default": "b",
 "type": "string/line"

}, "order": {

 "label": "ordering",
 "description": "“flip” returns converted value first, input value second.",
 "type": "string/line"

}, "sigfig": {

 "label": "significant figures",
 "description": "number that sets the number of significant figures",
 "type": "number"

}, "round": {

 "label": "rounding output",
 "description": "“5” rounds the output number to nearest multiple of 5, “25” to nearest multiple of 25, “each” rounds each number in a range",
 "type": "string/line"

}, "comma": {

 "label": "thousands separator",
 "description": "Sets or suppresses thousand separator in the numbers. “off” = no separator; “gaps”: use space not comma; “5” and “gaps5”: only add separator when number > 5 positions (10,000 or more)",
 "default": "on",
 "type": "string/line"

}, "sortable": {

 "label": "sort key",
 "description": "“on” generates a hidden sort key",
 "type": "string/line"

} }}</templatedata>

See also