Changes

Jump to: navigation, search

Template:Convert/doc

6,483 bytes added, 14:44, 11 April 2020
no edit summary
{{documentation subpage}}<!-- Documentation here EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->__NOTOC__==Purpose==
Converts Minecraft terms to real-life units To show quantities in a primary and vice versasecondary display, such as {{convert|32|m|ft|1}}, or {{convert|18|°C|°F|1}}.
; Parameters== Usage ==* <tt><nowiki>{{p</nowiki>convert|1}}: value to convert (e.g., ''2400original_value'')*{{p|2}}: full name of unit to convert from (e.g., ''mileoriginal_unit'')*{{p|3}}: full name of unit to convert to (e.g., ''kilometerconversion_unit'')*{{p|seperator''round_to''<nowiki>}}: optional seperator (defaults to a space with brackets)</nowiki></tt>
; Available units== Examples =={| class="wikitable"|'''Input'''||'''Displays as'''|-|<nowiki>{flatlist{convert|32|m|ft|0}}</nowiki>||{{convert|32|m|ft|0}}*fahrenheit|-*celsius|<nowiki>{{convert|18|°C|°F|1}}</nowiki>||{{convert|18|°C|°F|1}}*minute|-*second|<nowiki>{{convert|10|mi|km|0}}</nowiki>||{{convert|10|mi|km|0}}*kilograms|-*miles|<nowiki>{{convert|25|km|mi|0}}</nowiki>||{{convert|25|km|mi|0}}*kilometers|-|<nowiki>{{convert|1|lb|kg|0}}</nowiki>||{{convert|1|lb|kg|0}}|-| <nowiki>{{convert|1250|sqft|sqm|1|lk=on}}</nowiki> ||{{convert|1250|sqft|sqm|1|lk=on}} |- |<nowiki>{{convert|20.5|sqkm|sqmi|1|lk=on|abbr=on}}</nowiki>||{{convert|20.5|sqkm|sqmi|1|lk=on|abbr=on}}|-|<nowiki>{{convert|641|acre|sqmi|3|lk=on|abbr=on}}</nowiki>||{{convert|641|acre|sqmi|3|lk=on|abbr=on}}|-|''However''|||-|<nowiki>{{convert|641|acre|sqmi|2|lk=on|abbr=on}}</nowiki>||{{convert|641|acre|sqmi|2|lk=on|abbr=on}} because 640 acres equals one square mile; 641 acres rounded to 2 would equal 1.00&nbsp;sq&nbsp;mi. Therefore it is displayed as 1&nbsp;sq&nbsp;mi.|}
;Examples===Tricks===*{| class="wikitable"|-! colspan="2" | <big>'''In order to...'''</big>|-| Use [[United States|U.S.]] spelling || attach <code><nowiki>|sp=us</nowiki></code>|-| Make units [[Wikipedia:Manual of Style (using defaultslinks) – {{t|convertwikilinked]] |5}}| attach <code><nowiki>|lk=on</nowiki></code> (The [[WP: MOS|manual of style]] suggests that you only link the first instance).|-| Use the singular for grammar || attach <code><nowiki>|sing=on</nowiki></code> (ex: "The 190 foot (58 m) bridge" as opposed to "feet")|-| Abbreviate all units || attach <code><nowiki>|abbr=on</nowiki></code>|-| Use a / instead ( ) || attach <code><nowiki>|disp=slash</nowiki></code> (or shorthand: <code><nowiki>|disp=/</nowiki></code>) (ex: 190&nbsp;foot/58&nbsp;m)|} ===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 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 {{converttl|5convert}}.----*{| class="wikitable"|-! colspan="5" | <big>Units supported by {t{tl|convert}}</big>|2400-|mile'''system''' || '''unit''' || '''abbreviation ''used in coding'''''<br> (alternative abbreviations) || '''abbreviation ''printed''''' || [[Image:Flag of the United States.svg|20px]] '''US spelling''' <code><nowiki>|sp=us</nowiki></code>|-! colspan="5" style="font-size: 110%; text-align: left;" | '''Area'''|- style="font-size: 90%;"| style="text-align: center;" | '''[[International System of Units|SI]]''' || [[square metre]] || sqm || m² || square meter|- style="font-size: 90%;"| style="text-align: center;" | → || [[square kilometre]] || sqkm || km² || square kilometer|seperator{{- style=}}"font-size: 90%; background-color: #FFFFFF;"| style="text-align: center;" | '''[[Imperial system|Imperial]] &amp[[United States customary units|U.S.&nbsp;Customary]]''' || [[acre]] || acre || acre (or acres) |||- style="font-size: 90%; background-color: #FFFFFF;"| style="text-align: center;" | → || [[square foot]] ||sqft || sq&nbsp;ft |||->style="font-size: 90%; background-color: #FFFFFF;"| style="text-align: center;" | → || [[square yard]] ||sqyd || sq&ampnbsp;yd |||- style="font-size: 90%; background-color: #FFFFFF;"| style="text-align: center;" | → || [[square mile]] || sqmi || sq&nbsp;}}mi |||- style="font-size: {{convert90%; background-color: #FFFFFF;"| style="text-align: center;" | → |2400|[[square nautical mile]] || sqnmi || sq&nbsp;nmi |||- style="font-size: 90%;"| style="text-align: center;" | '''old metric''' || [[hectare]] || ha || ha |||-! colspan="5" style="font-size: 110%; text-align: left;" | '''Length'''|- style="font-size: 90%;"| style="text-align: center;" | '''SI''' || [[millimetre]] || mm || mm || millimeter|- style="font-size: 90%;"| style="text-align: center;" | → || [[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|seperator- style= "font-> }size: 90%; background-color: #FFFFFF;"| style="text-align: center;" | '''Imperial & U.S.&nbsp;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;" | '''Speed'''|- style="font-size: 90%;"| style="text-align: center;" | '''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.&nbsp;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 |||-! colspan="5" style="font-size: 110%; text-align: left;" | '''Temperature'''|- style="font-size: 90%;"| style="text-align: center;" | '''SI''' || [[kelvin]] || K || K |||- style="font-size: 90%;"| style="text-align: center;" | → || [[degrees Celsius]] || °C (C) || °C |||- style="font-size: 90%; background-color: #FFFFFF;"| style="text-align: center;" | '''Imperial & U.S.&nbsp;Customary''' || [[degrees Rankine]] || °R (R) || °R |||- style="font-size: 90%; background-color: #FFFFFF;"| style="text-align: center;" | → || [[degrees Fahrenheit]] || °F (F) || °F |||==Example/monitor page==Monitor quality or look at examples at [[Template:Convert/check]]
<includeonly>
<!-- Template categories/interwiki here ADD CATEGORIES BELOW THIS LINE -->[[Category:SI unit templates|{{PAGENAME}}]][[Category:Conversion templates| ]]<!-- ADD INTERWIKIS BELOW THIS LINE -->[[no:Mal:Convert]][[zh:Template:Convert]] 
</includeonly>
<noinclude>
<!-- Documentation categories/interwiki here -->
</noinclude>



Navigation menu