Template:Convert/doc: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Caesar Schinas
imported>Caesar Schinas
No edit summary
Line 1: Line 1:
{{TOC|right}}
{{TOC|right}}
This template is used in articles to easily convert one unit to another. This template will always be under construction, as we can’t possibly include conversions ‘’from’’ every possible unit ‘’to’’ every possible unit. However, whenever a conversion isn’t supported, [[User:Drew R. Smith|I]] or any of the other users who have worked on this template would be happy to add conversions when brought to our attention.
This template is used in articles to easily convert one unit to another. This template will always be under construction, as we can’t possibly include conversions ''from'' every possible unit ''to'' every possible unit. Should you find a combination of unis which isn't supported but which you think should be, please leave a note on the [[{{TALKPAGENAME}}|talk page]] and it will be added.<br />
The goal of this template is to make the ''Citizendium'' accessible to all readers regardless of nationality. Instead of only showing [[SI units|SI/Metric units]] or [[Imperial units]], {{tl|convert}} automatically converts a number from the specified unit to another unit and displays it as "'''Metric (Imperial)'''" or "'''Imperial (Metric)'''", depending on which unit was converted from.
The goal of this template is to make the ''Citizendium'' accessible to all readers regardless of nationality. Instead of only showing [[SI units|SI/Metric units]] or [[Imperial units]], {{tl|convert}} automatically converts a number from the specified unit to another unit and displays it as "'''Metric (Imperial)'''" or "'''Imperial (Metric)'''", depending on which unit was converted from.


Line 11: Line 11:


The names of the units can be specified as either abbreviations or full words, using either British or American spelling. The unit names in the output will be in the same format as the input.
The names of the units can be specified as either abbreviations or full words, using either British or American spelling. The unit names in the output will be in the same format as the input.
==Supported Conversions==
<small>Transcluded from [[Template:Convert/doc/conversions]] ({{plainlink|{{fullurl:Template:Convert/doc/conversions|action=edit}} edit}})</small>
<div style="height:400px; overflow:auto; padding:0.5em; border:1px solid #AAAAAA;" >
{{Convert/doc/conversions}}
</div>


== Examples ==
== Examples ==
Line 40: Line 34:
|}
|}


==Supported Conversions==
<small>Transcluded from [[Template:Convert/doc/conversions]] ({{plainlink|{{fullurl:Template:Convert/doc/conversions|action=edit}} edit}})</small>
<div style="height:400px; overflow:auto; padding:0.5em; border:1px solid #AAAAAA;" >
{{Convert/doc/conversions}}
</div>


<includeonly>[[Category:Conversion templates]]</includeonly>
<includeonly>[[Category:Conversion templates]]</includeonly>

Revision as of 02:32, 16 June 2009

This template is used in articles to easily convert one unit to another. This template will always be under construction, as we can’t possibly include conversions from every possible unit to every possible unit. Should you find a combination of unis which isn't supported but which you think should be, please leave a note on the talk page and it will be added.
The goal of this template is to make the Citizendium accessible to all readers regardless of nationality. Instead of only showing SI/Metric units or Imperial units, {{convert}} automatically converts a number from the specified unit to another unit and displays it as "Metric (Imperial)" or "Imperial (Metric)", depending on which unit was converted from.

Usage

The template has four parameters - {{convert|number|from|to|precision}}.

  1. required — The number to convert.
  2. required — The unit to convert from.
  3. required — The unit to convert to.
  4. optional — The precision of the result. Positive values cause the specified number of decimal places to be shown, whilst negative values cause the numbers to be rounded to the specified number of significant figures. The default value is 2 (2 decimal places).

The names of the units can be specified as either abbreviations or full words, using either British or American spelling. The unit names in the output will be in the same format as the input.

Examples

Code Result Notes
{{convert|123.4|km|mi}} 123.4 km (76.68 mi) Simple conversion of 123.4 kilometres to miles.
{{convert|12|in|cm}} 12 in (30 cm) Convert 12 in to cm, rounding to the nearest whole cm.
{{convert|60|nmi|mi}} 60 nmi (69.046767 mi) Convert 60 nautical miles to statute miles, showing the result to 6 decimal places.
{{convert|60|nmi|mi}} 60 nautical miles (70 miles) Convert 60 nautical miles to statute miles, and round the result to one significant figure.

Supported Conversions

Transcluded from Template:Convert/doc/conversions (edit)

Length Conversions

Metric to Imperial

Inches (in) Feet (ft) Yards (yd) Miles (mi) Nautical Miles (nmi)
Millimetres (mm) Yes Yes No No No
Centimetres (cm) Yes Yes No No No
Decimetres (dm) Yes Yes No No No
Metres (m) Yes Yes Yes Yes Yes
Kilometres (km) No No Yes Yes Yes

Imperial to Metric

Millimetres (mm) Centimetres (cm) Decimetres (dm) Metres (m) Kilometres (km)
Inches (in) Yes Yes Yes Yes No
Feet (ft) Yes Yes Yes Yes Yes
Yards (yd) Yes Yes Yes Yes Yes
Miles (mi) No No No Yes Yes
Nautical Miles (nmi) No No No Yes Yes

Imperial to Imperial

Miles (mi) Nautical Miles (nmi)
Miles (mi) - Yes
Nautical Miles (nmi) Yes -

Weight Conversions

Kilogrammes (kg) Grammes (g) Pounds (lbs) Ounces (oz)
Kilogrammes (kg) - No Yes Yes
Grammes (g) No - Yes Yes
Pounds (lbs) Yes Yes - No
Ounces (oz) Yes Yes No -

Temperature Conversions

Celsius (°C) Kelvin (°K) Fahrenheit (°F) Rankine (°R)
Celsius (°C) - Yes Yes Yes
Kelvin (°K) Yes - Yes No
Fahrenheit (°F) Yes Yes - Yes
Rankine (°R) Yes No Yes -