289
edits
Changes
no edit summary
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
{| class="wikitable"
|'''Input'''||'''Displays as'''
|-
|<nowiki>{{convert|3.2132|kgm|lbft|0}}</nowiki>||{{convert|3.2132|m|kgft|lb0}}
|-
|<nowiki>{{convert|3.2118|kg°C|lb°F|01}}</nowiki>||{{convert|3.2118|kg°C|lb°F|01}}
|-
|<nowiki>{{convert|10|kgmi|lbkm|disp=or0}}</nowiki>||{{convert|10|kgmi|lbkm|disp=or0}}
|-
|<nowiki>{{convert|625|ftkm|5mi|in|m0}}</nowiki>||{{convert|625|ftkm|5mi|in|m0}}<!--This is currently broken, see talk page
|-
|<nowiki>{{convert|21|mlb|ftinkg|0}}</nowiki>||{{convert|21|mlb|ftinkg|0}}-->
|-
|-
|<nowiki>{{convert|20.5|m3sqkm|cuydsqmi|1|lk=outon|abbr=on}}</nowiki>||{{convert|20.5|m3sqkm|cuydsqmi|1|lk=outon|abbr=on}}<br />Note 'lk=out' links only the output unit, [[w:cu yd|cu yd]].
|-
|<nowiki>{{convert|641|acre|ha sqmi|3|lk=on|abbr=on}}</nowiki>||{{convert|641|acre|ha sqmi|3|lk=on}}<br />Note 'lk|abbr=on' links all units. Common units should not be linked.}}
|-
|<nowiki>{{convert|641|acre|ha sqmi|2|lk=on}}</nowiki>||{{convert|641|acre|ha sqmi|2|lk=on}}<br /> Although 640 acres equals 1 square mile; 641 acres rounded to two decimal places equals 1.00 sq mi.|} ====Range of 2 values====:''Note: not yet operational for all unitsHowever''{| class="wikitable"|'''Input'''||'''Displays as'''|-|<nowiki>{{convert|60|and|170|kg|lb}}</nowiki>||{{convert|60|and|170|kg|lb}}|-|<nowiki>{{convert|60|to|170|kg|lb}}</nowiki>||{{convert|60|to|170|kg|lb}}|-|<nowiki>{{convert|60|to(-)|170|kg|lb}}</nowiki>||{{convert|60|to(-)|170|kg|lb}}|-|<nowiki>{{convert|60|-|170|kg|lb}}</nowiki>||{{convert|60|-|170|kg|lb}}|-|<nowiki>{{convert|41|to|50|F|C}}</nowiki>||{{convert|41|to|50|F|C}}|-|<nowiki>{{convert|41|-|50|F|K}}</nowiki>||{{convert|41|-|50|F|K}}|-|<nowiki>{{convert|60|x|120|m|ft}}</nowiki>||{{convert|60|x|120|m|ft}}|-|<nowiki>{{convert|60|+/-|10|m|ft}}</nowiki>||{{convert|60|+/-|10|m|ft}}|-|<nowiki>{{convert|19|to|27|L|USgal}}</nowiki>||{{convert|19|to|27|L|USgal}}|-|<nowiki>{{convert|5|to|7|L|USgal|abbr=mos}}</nowiki>||{{convert|5|to|7|L|USgal|abbr=mos}}|-|<nowiki>{{convert|4|-|9|L|USgal|abbr=off}}</nowiki>||{{convert|4|-|9|L|USgal|abbr=off}}|-|}<!--NOTE: rows require "nowiki", using {{ disappears. --> The following conversions are currently not available as a range of values:*Some imperial and US gallon-based units*Other fuel-consumption units, except "mpg" or "L100km" shown above.*Large scale units (e3, e6, e9)*Combination-based units (ft&in, st&lb, lb&oz) due to complexity of the conversion. ====Range/set of 3 values====:''Note: not yet operational for all units''{| class="wikitable"|'''Input'''||'''Displays as'''|-|<nowiki>{{convert/3 |2|x|4|x|6|m|ft}}</nowiki>||{{convert/3 |2|x|4|x|6|m|ft}}|-|<nowiki>{{convert/3 |60|-|70|-|80|kg|lb}}</nowiki>||{{convert/3|60|-|70|-|80|kg|lb}}|-|<nowiki>{{convert/3 |60|to|80|or|85|m|ft}}</nowiki>||{{convert/3 |60|to|80|or|85|m|ft}}|-|<nowiki>{{convert/3 |11|by|15|rarely|16|ft|m}}</nowiki>||{{convert/3 |11|by|15|rarely|16|ft|m}}|-|<nowiki>{{convert/3 |41|to|50|to|60|F|C}}</nowiki>||{{convert/3 |41|to|50|to|60|F|C}}
|-
|<nowiki>{{convert/3 |41641|-acre|50sqmi|almost2|51lk=on|F|Kabbr=on}}</nowiki>||{{convert/3 |41|-641|50acre|almostsqmi|512|Flk=on|Kabbr=on}}because 640 acres equals one square mile; 641 acres rounded to 2 would equal 1.00 sq mi. Therefore it is displayed as 1 sq mi.
|}
===ParametersTricks===
{| class="wikitable"
|-
! colspan="2" | Parameters<big>'''In order to...'''</big>
|-
| {{anchor|sp_uk}}Use [[w:British EnglishUnited States|UK spellingU.S.]] spelling || attach <code><nowiki>|sp=ukus</nowiki></code>
|-
| {{anchor|lk_in}}Make units linked| attach <code><nowiki>|lk=on</nowiki></code> to link all units [[Wikipedia:Manual of Style (default: <tt>lk=off</tt>links)<br /> attach <code><nowiki>|lk=in</nowiki></code> to link only the input units<br /> wikilinked]] || attach <code><nowiki>|lk=outon</nowiki></code> to link only the output units<br />(The [[WikibooksWP:DewikifyMOS|manual of style]] suggests that you should not only link common units of measurementthe first instance).
|-
| {{anchor|adj_on}}Use the adjective form, or insert mid-text words singular for grammar || attach <code><nowiki>|adjsing=on</nowiki></code> (e.g. "190-foot (58 m) bridge" instead of "190 feet...").ex:: This produces the adjective form—the unit name in the singular with a hyphen.attach <code><nowiki>|adj=mid</nowiki></code> (e.g. "The 190-foot bridge (58 m)" as: |adj=mid|bridge:: or "190-foot-long bridge (58 m)" as: |adj=mid|-long bridge)Note 1: Any rounding-parameter should follow the mid-text: opposed to "text|0".<br>Note 2: For adj=mid, must specify both input & output unit-codes.:: For example, to convert feet, use "ft|m" or "ft|0":<br> • <nowiki>{{convert|9|ft|m|adj=mid|-long}}</nowiki> → 9-foot-long (2.7 m)<br>To default the output unit-code, set parameter 3 to: 0.
|-
| Abbreviate all units, or not | {{anchor|abbr_on}}attach <code><nowiki>|abbr=on</nowiki></code> to show unit symbols<br /> attach <code><nowiki>|abbr=off</nowiki></code> to show all unit names in full words<br /> attach <code><nowiki>|abbr=in</nowiki></code> to abbreviate input units<br /> attach <code><nowiki>|abbr=out</nowiki></code> to abbreviate output units<br /> attach <code><nowiki>|abbr=values</nowiki></code> to suppress unit names & show only values. So, <nowiki>{{convert|6|mi|abbr=values}}</nowiki> gives: {{convert|6|mi|abbr=values}}.
|-
| {{anchor|disp_or}}Change "( )" to display other separators | attach <code>|disp=comma<Use a /code> to put comma, not brackets/parentheses<br /> attach <code>|disp=or</code> to put "or" between units.<br /> The default value is: disp=b for brackets/parentheses.|-| Change "instead ( )" to customized separators | attach <code>|disp=x| (begin | end)</code> to show "xx (begin yy end)" See example 1<br /> attach <code>|disp=x|;</code> to show "xx; yy" See example 2<br /> attach <code>|disp=x| (same as |)</code> to show "xx (same as yy)". See example 3<br />Example 1: {{nowrap|<nowiki>{{convert|9|km|mi|disp=x| [|]}}</nowiki>}}→{{nowrap|9 kilometres [5.6 mi]}} (note space before <nowiki>[|</nowiki>)<br />Example 2: {{nowrap|<nowiki>{{convert|9|km|mi|disp=x|;}}</nowiki>}}→{{nowrap|9 kilometres;5.6 mi}}<br />Example 3: {{nowrap|<nowiki>{{convert|10|km|mi|disp=x| (about |)}}</nowiki>}}→{{nowrap|10 kilometres (about 6.2 mi)}} (note spaces used within the code).|-| Display output only | attach <code>|disp=output only</code> to show result number & unit<br /> attach <code>|disp=output number only</code> to show just number<br />Note when using "disp=output only" then the unit name can still be shown as full words by abbr=off or linked by lk=on.|-| Display units inverted as reverse order| attach <code>|disp=flip</code> to reverse the order & show output unit first.<br />So, <nowiki>{{convert|6|km|disp=flip}}slash</nowiki> shows "3.7 miles (6 km)".<br />To get symbol "mi" use abbr=in, to abbreviate the input unit (left-side unit).|-| Display unit name (only) | attach <code>|disp=unit</code> to show the unit name for a symbol<br />The unit name will be plural when the amount is not 1, or hyphenated when adj=on. So, <nowiki>{{convert|2|cuyd|disp=unit}}</nowiki> shows "cubic yards" plural.|-| {{anchor|disp_table}}Display amounts as table cells | attach <tt>|disp=table</tt> (or <tt>|disp=tablecen</tt>) Noteshorthand: For use in tables, the template must start on a new line after a pipe. Only the number will be displayed unless you set <code><nowiki>|abbrdisp=on</nowiki></code>, <code><nowiki>|lk=on</nowiki></code>, <code><nowiki>|lk=in</nowiki></code> or <code><nowiki>|lk=out</nowiki></code>.|-| Round to a specified number of [[w) (ex:significant figures|significant figures]]| attach <code><nowiki>|sigfig={some integer greater than zero}</nowiki></code>. In the case of temperatures Celsius or Fahrenheit this refers to the difference with the absolute-zero temperature. For example, at room temperature two significant digits means rounded to tens of degrees.|-| Round by 5 | attach <tt>190|nbsp;disp=5<foot/tt> 58 to round the output amount to the nearest 5 units. Not supported for all options.|-| Let ''Convert'' decide the unit to convert to|| skip the ''precision'' parameter (the 3rd or 4th unnamed parameterm) e.g. <code><nowiki>{{convert|100|km|kn}}</nowiki></code> gives ''{{convert|100|km|kn}}'' and <code><nowiki>{{convert|100|km}}</nowiki></code> gives ''{{convert|100|km}}''.|-|Display input value with a fraction| <nowiki>{{convert|3/8|in|mm|3|abbr=on}}</nowiki> → {{convert|3/8|in|mm|3|abbr=on}} or <nowiki>{{convert|11+1/4|in|cm|2|abbr=on}}</nowiki> → {{convert|11+1/4|in|cm|2|abbr=on}}For negative amounts, use two minus signs (hyphens): -11-1/4.|-|{{anchor|sortable_on}}Generate a hidden sort key for use with a [[Help:Tables#Sortable_tables|sortable table]]| attach <code><nowiki>|sortable=on</nowiki></code> to generate a hidden sort key so that [[Help:Tables#Sortable_tables|sortable tables]] will sort correctly. This uses {{tl|ntsh}} to generate a sort key from the first numeric value. It ignores any additional values, i.e., if you use <code>6|ft|2|in</code> as the value, it will only use the 6 for the sort key. This will cause numeric values to sort in numeric order, i.e.: 5, 10, 15 instead of 10, 15, 5.
|}
===Rounding=Parameters still under construction==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 8600. If the result is '234.0283043' and the round number is '0', the result will be 234. ==Conversions ==The abbreviations to the right of the units are the abbreviations that can be entered when using the template. Through various revisions of this template, some units have incorporated multiple abbreviations to make the code more flexible for editors, e.g. °F ''or'' F may be entered. Though they may not be the correct abbreviations, the ''correct abbreviation'' will always be displayed when you use {{tl|convert}}.----
{| class="wikitable"
|-
! colspan="25" | Parameters still under construction. May not work in all situations<big>Units supported by {{tl|convert}}</big>
|-
| disp=5'''system''' || '''unit''' || '''abbreviation ''used in coding'''''<ref name=temp group=notebr>This is a limited, temporary option, until an (alternative can be implemented.</ref> abbreviations) || The output will be rounded to '''abbreviation ''printed''''' || [[Image:Flag of the nearest 5 units. Might not work when linking unit namesUnited States.svg|20px]] '''US spelling''' <code><nowiki>|sp=us</nowiki></code>
|-
! colspan="5" style="font-size: 110%; text-align: left;" |disp'''Area'''|- style=tablecen<ref name"font-size: 90%;"| style=temp group"text-align: center;" | '''[[International System of Units|SI]]''' || [[square metre]] || sqm || m² || square meter|- style=note/>"font-size: 90%;"|style="text-align: center;" |Similar to disp→ || [[square kilometre]] || sqkm || km² || square kilometer|- style=table except that the values will be centered within the column"font-size: 90%; background-color: #FFFFFF;"| style="text-align: center;" | '''[[Imperial system|Imperial]] & [[United States customary units|U.S. Customary]]''' || [[acre]] || acre || acre (or acres) |||- style="font-size: 90%; background-color: #FFFFFF;"| style="text-align: center;" | → || [[square foot]] ||sqft || sq ft |||- style="font-size: 90%; background-color: #FFFFFF;"| style="text-align: center;" | → || [[square yard]] ||sqyd || sq yd |||- style="font-size: 90%; background-color: #FFFFFF;"| style="text-align: center;" | → || [[square mile]] || sqmi || sq mi |||- style="font-size: 90%; background-color: #FFFFFF;"| style="text-align: center;" | → || [[square nautical mile]] || sqnmi || sq nmi |||- style="font-size: 90%;"| style="text-align: center;" | '''old metric''' || [[hectare]] || ha || ha ||
|-
! colspan="5" style="font-size: 110%; text-align: left;" |disp'''Length'''|- style=comma<ref name"font-size: 90%;"| style=temp group"text-align: center;" | '''SI''' || [[millimetre]] || mm || mm || millimeter|- style=note/>"font-size: 90%;"|style="text-align: center;" |The two values will be separated by a comma, for situations where the first value is already within parentheses→ || [[centimetre]] || cm || cm || centimeter|- style="font-size: 90%;"| style="text-align: center;" | → || [[metre]] || m || m || meter|- style="font-size: 90%;"| style="text-align: center;" | → || [[kilometre]] || km || km || kilometer|- style="font-size: 90%; background-color: #FFFFFF;"| style="text-align: center;" | '''Imperial & U.S. Customary''' || [[inch]] || in || in |||- style="font-size: 90%; background-color: #FFFFFF;"| style="text-align: center;" | → || [[foot (unit of length)|foot]] || ft || ft |||- style="font-size: 90%; background-color: #FFFFFF;"| style="text-align: center;" | → || [[yard]] || yd || yd |||- style="font-size: 90%; background-color: #FFFFFF;"| style="text-align: center;" | → || [[mile]] || mi || mi |||- style="font-size: 90%; background-color: #FFFFFF;"| style="text-align: center;" | → || [[nautical mile]] || nmi || nmi |||- style="font-size: 90%;"| style="text-align: center;" | '''Other''' || [[astronomical unit]] || AU || AU ||
|-
! colspan="5" style="font-size: 110%; text-align: left;" |abbr'''Speed'''|- style=in"font-size: 90%;"|style="text-align: center;" |Abbreviates only the input unit'''SI''' || [[metres per second]] || m:s (m/s) || m/s || meter per second|- style="font-size: 90%;"| style="text-align: center;" | → || [[kilometres per hour]] || km:h (km/h ''or'' kph)|| km/h || kilometer per hour|- style="font-size: 90%; background-color: #FFFFFF;"| style="text-align: center;" | '''Accepted ''non''-SI''' || [[knot (speed)|knot]] || knot || kt |||- style="font-size: 90%;"| style="text-align: center;" | '''Imperial & U.S. Customary''' || [[feet per second]] || ft:s (ft/s) || ft/s |||- style="font-size: 90%;"| style="text-align: center;" | → || [[miles per hour]] || mi:h (mph ''or'' mi/h) || mph ||
|-
|}
===Rounding=Example/monitor page==''Monitor quality or look at examples at [[Template:Convert'' supports four types of rounding:;Rounding to a given 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 {{frac|10}} 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./check]]
<includeonly>
<!-- ADD CATEGORIES BELOW THIS LINE -->
[[Category:Function SI unit templates|{{PAGENAME}}]][[Category:Conversion templates| ]]
<!-- ADD INTERWIKIS BELOW THIS LINE -->
[[no:Mal:Convert]]
[[zh:Template:Convert]]
</includeonly>