Template:Convert: Difference between revisions
Jump to navigation
Jump to search
>Drumguy8800 m (typo) |
>Drumguy8800 (reorder, rm unnecessary coding, add mph and kph) |
||
Line 1: | Line 1: | ||
{{formatnum:{{{1}}}}} {{#switch: {{{lk|}}}|on=[[{{#switch: {{{2|}}} | {{formatnum:{{{1}}}}} {{#switch: {{{lk|}}}|on=[[{{#switch: {{{2|}}} | ||
|ft= foot (unit of length){{!}}{{#ifeq:{{{1}}}|1|foot|feet}} | |ft= foot (unit of length){{!}}{{#ifeq:{{{1}}}|1|foot|feet}} | ||
|in= inch{{#ifeq:{{{1}}}|1||{{!}}inches}} | |in= inch{{#ifeq:{{{1}}}|1||{{!}}inches}} | ||
|mm= {{#switch: {{{sp|}}}|us=millimeter|=millimetre}}{{#ifeq:{{{1}}}|1||{{!}}{{#switch: {{{sp|}}}|us=millimeters|=millimetres}}}} | |mm= {{#switch: {{{sp|}}}|us=millimeter|=millimetre}}{{#ifeq:{{{1}}}|1||{{!}}{{#switch: {{{sp|}}}|us=millimeters|=millimetres}}}} | ||
|cm= {{#switch: {{{sp|}}}|us=centimeter|=centimetre}}{{#ifeq:{{{1}}}|1||{{!}}{{#switch: {{{sp|}}}|us=centimeters|=centimetres}}}} | |cm= {{#switch: {{{sp|}}}|us=centimeter|=centimetre}}{{#ifeq:{{{1}}}|1||{{!}}{{#switch: {{{sp|}}}|us=centimeters|=centimetres}}}} | ||
Line 11: | Line 8: | ||
|mi= mile{{#ifeq:{{{1}}}|1||{{!}}miles}} | |mi= mile{{#ifeq:{{{1}}}|1||{{!}}miles}} | ||
|nmi= nautical mile{{#ifeq:{{{1}}}|1||{{!}}nautical miles}} | |nmi= nautical mile{{#ifeq:{{{1}}}|1||{{!}}nautical miles}} | ||
|acre= acre{{#ifeq:{{{1}}}|1||{{!}}acres}} | |||
|ha= hectare{{#ifeq:{{{1}}}|1||{{!}}hectares}} | |||
|sqft= square foot{{!}}square {{#ifeq:{{{1}}}|1|foot|feet}} | |||
|sqm= square {{#switch: {{{sp|}}}|us=meter|=metre}}{{#ifeq:{{{1}}}|1||{{!}}square {{#switch: {{{sp|}}}|us=meters|=metres}}}} | |sqm= square {{#switch: {{{sp|}}}|us=meter|=metre}}{{#ifeq:{{{1}}}|1||{{!}}square {{#switch: {{{sp|}}}|us=meters|=metres}}}} | ||
|sqkm= square kilometre{{#ifeq:{{{1}}}|1||{{!}}square kilometres}} | |sqkm= square kilometre{{#ifeq:{{{1}}}|1||{{!}}square kilometres}} | ||
Line 16: | Line 16: | ||
|sqnmi=square nautical miles{{#ifeq:{{{1}}}|1||{{!}}square nautical miles}} | |sqnmi=square nautical miles{{#ifeq:{{{1}}}|1||{{!}}square nautical miles}} | ||
}}]]|={{#switch: {{{2|}}} | }}]]|={{#switch: {{{2|}}} | ||
|ft= {{#ifeq:{{{1}}}|1|foot|feet}} | |ft= {{#ifeq:{{{1}}}|1|foot|feet}} | ||
|in= {{#ifeq:{{{1}}}|1|inch|inches}} | |in= {{#ifeq:{{{1}}}|1|inch|inches}} | ||
|mm= {{#ifeq:{{{1}}}|1|{{#switch: {{{sp|}}}|us=millimeter|=millimetre}}|{{#switch: {{{sp|}}}|us=millimeters|=millimetres}}}} | |mm= {{#ifeq:{{{1}}}|1|{{#switch: {{{sp|}}}|us=millimeter|=millimetre}}|{{#switch: {{{sp|}}}|us=millimeters|=millimetres}}}} | ||
|cm= {{#ifeq:{{{1}}}|1|{{#switch: {{{sp|}}}|us=centimeter|=centimetre}}|{{#switch: {{{sp|}}}|us=centimeters|=centimetres}}}} | |cm= {{#ifeq:{{{1}}}|1|{{#switch: {{{sp|}}}|us=centimeter|=centimetre}}|{{#switch: {{{sp|}}}|us=centimeters|=centimetres}}}} | ||
Line 27: | Line 24: | ||
|mi= {{#ifeq:{{{1}}}|1|mile|miles}} | |mi= {{#ifeq:{{{1}}}|1|mile|miles}} | ||
|nmi= {{#ifeq:{{{1}}}|1|nautical mile|nautical miles}} | |nmi= {{#ifeq:{{{1}}}|1|nautical mile|nautical miles}} | ||
|acre= {{#ifeq:{{{1}}}|1|acre|acres}} | |||
|ha= {{#ifeq:{{{1}}}|1|hectare|hectares}} | |||
|sqft= {{#ifeq:{{{1}}}|1|square foot|square feet}} | |||
|sqm= {{#ifeq:{{{1}}}|1|square {{#switch: {{{sp|}}}|us=meter|=metre}}|square {{#switch: {{{sp|}}}|us=meters|=metres}}}} | |sqm= {{#ifeq:{{{1}}}|1|square {{#switch: {{{sp|}}}|us=meter|=metre}}|square {{#switch: {{{sp|}}}|us=meters|=metres}}}} | ||
|sqkm= {{#ifeq:{{{1}}}|1|square {{#switch: {{{sp|}}}|us=kilometer|=kilometre}}|square {{#switch: {{{sp|}}}|us=kilometers|=kilometres}}}} | |sqkm= {{#ifeq:{{{1}}}|1|square {{#switch: {{{sp|}}}|us=kilometer|=kilometre}}|square {{#switch: {{{sp|}}}|us=kilometers|=kilometres}}}} | ||
|sqmi= {{#ifeq:{{{1}}}|1|square mile|square miles}} | |sqmi= {{#ifeq:{{{1}}}|1|square mile|square miles}} | ||
|sqnmi={{#ifeq:{{{1}}}|1|square nautical mile|square nautical miles}} | |sqnmi={{#ifeq:{{{1}}}|1|square nautical mile|square nautical miles}} | ||
|mph= {{#ifeq:{{{1}}}|1|miles per hour|mile per hour}} | |||
|kph= {{#ifeq:{{{1}}}|1|{{#switch: {{{sp|}}}|us=kilometer|=kilometre}} per hour|{{#switch: {{{sp|}}}|us=kilometers|=kilometres}} per hour}} | |||
}}}} ({{formatnum:{{ #expr: {{{1}}} * {{ #switch: {{{2|}}} | }}}} ({{formatnum:{{ #expr: {{{1}}} * {{ #switch: {{{2|}}} | ||
|ft = {{#switch: {{{3|}}} | |ft = {{#switch: {{{3|}}} | ||
|in=12 | |in=12 | ||
Line 57: | Line 51: | ||
|mi=0.0000157828283 | |mi=0.0000157828283 | ||
|nmi=0.0000137149028 | |nmi=0.0000137149028 | ||
}} | }} | ||
|mm = {{#switch: {{{3|}}} | |mm = {{#switch: {{{3|}}} | ||
Line 100: | Line 78: | ||
|mi=0.000621371192 | |mi=0.000621371192 | ||
|nmi=0.000539956803 | |nmi=0.000539956803 | ||
}} | }} | ||
|km = {{#switch: {{{3|}}} | |km = {{#switch: {{{3|}}} | ||
Line 117: | Line 87: | ||
|mi=0.621371192 | |mi=0.621371192 | ||
|nmi=0.539956803 | |nmi=0.539956803 | ||
}} | }} | ||
|mi = {{#switch: {{{3|}}} | |mi = {{#switch: {{{3|}}} | ||
Line 134: | Line 96: | ||
|km=1.609344 | |km=1.609344 | ||
|nmi=0.868976242 | |nmi=0.868976242 | ||
}} | }} | ||
|nmi = {{#switch: {{{3|}}} | |nmi = {{#switch: {{{3|}}} | ||
Line 151: | Line 105: | ||
|m=1852 | |m=1852 | ||
|km=1.852 | |km=1.852 | ||
}} | |||
|acre = {{#switch: {{{3|}}} | |||
|ha=0.404685642 | |||
|sqft=43560 | |||
|sqm=4046.85642 | |||
|sqkm=0.00404685642 | |||
|sqmi=0.0015625 | |||
|sqnmi=0.00117987455 | |||
}} | |||
|ha = {{#switch: {{{3|}}} | |||
|acre=2.47105381 | |||
|sqft=107639.104 | |||
|sqm=10000 | |||
|sqkm=0.01 | |||
|sqmi=0.00386102159 | |||
|sqnmi=0.0029155335 | |||
}} | |||
|sqft = {{#switch: {{{3|}}} | |||
|acre=0.0000229568411 | |||
|ha=0.00009290304 | |||
|sqm=0.09290304 | |||
|sqkm=0.00000009290304 | |||
|sqmi=0.0000000358700643 | |||
|sqnmi=0.0000000270861925 | |||
}} | |||
|sqm = {{#switch: {{{3|}}} | |||
|acre=0.000247105381 | |||
|ha=0.0001 | |||
|sqft=10.7639104 | |||
|sqkm=0.000001 | |||
|sqmi=0.000000386102159 | |||
|sqnmi=0.00000029155335 | |||
}} | |||
|sqkm = {{#switch: {{{3|}}} | |||
|acre=247.105381 | |||
|ha=100 | |||
|sqft=10763910.4 | |||
|sqm=1000000 | |||
|sqmi=0.386102159 | |||
|sqnmi=0.29155335 | |||
}} | |||
|sqmi = {{#switch: {{{3|}}} | |||
|acre=640 | |||
|ha=258.998811 | |||
|sqft=27878400 | |||
|sqm=2589988.11 | |||
|sqkm=2.58998811 | |||
|sqnmi=0.755119709 | |||
}} | }} | ||
|sqnmi= {{#switch: {{{3|}}} | |sqnmi= {{#switch: {{{3|}}} | ||
Line 159: | Line 161: | ||
|sqkm=3.429904 | |sqkm=3.429904 | ||
|sqmi=1.32429334 | |sqmi=1.32429334 | ||
}} | |||
|mph= {{#switch: {{{3|}}} | |||
|kph=1.609344 | |||
}} | |||
|kph= {{#switch: {{{3|}}} | |||
|mph=0.621371192 | |||
}} | }} | ||
}} {{#if: {{{4|}}} | round {{{4}}} }}}}}} {{#switch: {{{lk|}}}|on=[[{{#switch: {{{3|}}} | }} {{#if: {{{4|}}} | round {{{4}}} }}}}}} {{#switch: {{{lk|}}}|on=[[{{#switch: {{{3|}}} | ||
|ft= foot (unit of length){{!}}ft | |ft= foot (unit of length){{!}}ft | ||
|in= inch{{!}}in | |in= inch{{!}}in | ||
|mm= millimetre{{!}}mm | |||
|mm= | |cm= centimetre{{!}}cm | ||
|cm= | |m= metre{{!}}m | ||
|m= | |km= kilometre{{!}}km | ||
|km= | |||
|mi= mile{{!}}mi | |mi= mile{{!}}mi | ||
|nmi= nautical mile{{!}}nmi | |nmi= nautical mile{{!}}nmi | ||
|acre= acre | |||
|ha= hectare{{!}}ha | |||
|sqft= square foot{{!}}ft² | |sqft= square foot{{!}}ft² | ||
|sqm= square | |sqm= square metre{{!}}m² | ||
|sqkm= square | |sqkm= square kilometre{{!}}km² | ||
|sqmi= square mile{{!}}mi² | |sqmi= square mile{{!}}mi² | ||
|sqnmi=square nautical mile{{!}}nmi² | |sqnmi=square nautical mile{{!}}nmi² | ||
|mph= miles per hour{{!}}mph | |||
|kph= kilometres per hour{{!}}kph | |||
}}]]|={{#switch: {{{3|}}} | }}]]|={{#switch: {{{3|}}} | ||
|ft= ft | |ft= ft | ||
|in= in | |in= in | ||
|mm= mm | |mm= mm | ||
|cm= cm | |cm= cm | ||
Line 187: | Line 195: | ||
|mi= mi | |mi= mi | ||
|nmi= nmi | |nmi= nmi | ||
|acre= acre | |||
|ha= ha | |||
|sqft= ft² | |sqft= ft² | ||
|sqm= m² | |sqm= m² | ||
Line 192: | Line 202: | ||
|sqmi= mi² | |sqmi= mi² | ||
|sqnmi=nmi² | |sqnmi=nmi² | ||
|mph= mph | |||
|kph= kph | |||
}}}})<noinclude>{{esoteric}} | }}}})<noinclude>{{esoteric}} | ||
;Two things to remember! | ;Two things to remember! | ||
*[[Image:Flag of the United States.svg|20px]] '''U.S. USERS''': If you prefer '''meter''' over '''metre''' for your article, simply attatch <code><nowiki>|sp=us</nowiki></code> to the end of the template! | *[[Image:Flag of the United States.svg|20px]] '''U.S. USERS''': If you prefer '''meter''' over '''metre''' for your article, simply attatch <code><nowiki>|sp=us</nowiki></code> to the end of the template! | ||
*To make the units [[Wikipedia:Manual of Style (links)|link]] to unit articles, add <code><nowiki>|lk=on</nowiki></code> to the end of the template! The [[WP:MOS|manual of style]] suggests that you only link the first instance.<br/><br/>Use in the following matter: <code><nowiki>{{convert|original value|original unit|conversion unit|round to}}</nowiki></code><br/><br/>'''Rounding:''' The number given for rounding rounds off the result to the power of 1/10 the rounding number. For instance, if the result is 8621 and the round number is '-2', the result will be 8700. If the result is '234.0283043' and the round number is '0', the result will be 234.</noinclude> | *To make the units [[Wikipedia:Manual of Style (links)|link]] to unit articles, add <code><nowiki>|lk=on</nowiki></code> to the end of the template! The [[WP:MOS|manual of style]] suggests that you only link the first instance.<br/><br/>Use in the following matter: <code><nowiki>{{convert|original value|original unit|conversion unit|round to}}</nowiki></code><br/><br/>'''Rounding:''' The number given for rounding rounds off the result to the power of 1/10 the rounding number. For instance, if the result is 8621 and the round number is '-2', the result will be 8700. If the result is '234.0283043' and the round number is '0', the result will be 234.</noinclude> |
Revision as of 13:38, 31 December 2006
{{{1}}} (Expression error: Unrecognized punctuation character "{". )Template:Esoteric
- Two things to remember!
- U.S. USERS: If you prefer meter over metre for your article, simply attatch
|sp=us
to the end of the template! - To make the units link to unit articles, add
|lk=on
to the end of the template! The manual of style suggests that you only link the first instance.
Use in the following matter:{{convert|original value|original unit|conversion unit|round to}}
Rounding: The number given for rounding rounds off the result to the power of 1/10 the rounding number. For instance, if the result is 8621 and the round number is '-2', the result will be 8700. If the result is '234.0283043' and the round number is '0', the result will be 234.