Changes

Jump to: navigation, search

Template:Convert

1,696 bytes removed, 18:19, 10 April 2020
no edit summary
<noinclude>This tempalte allows for an easy way to convert units. To use the template place <nowikiincludeonly>{{convert|</nowiki>'''Value 1'''|'''Value 2'''<nowiki>}}</nowiki>The first value given to the template, indicates what unit you are supplying (acceptable values are kg, lbs, g, oz, in, cm, mm). The Second parameter is the value you want to convert.=Examples===Ex 1==<div style="width: 400px; font-size:125%;"><pre>* '''Weight'''#ifeq: {{convert|kg|5}}</pre></div>Produces:* '''Weight''': {{convertsortable|kg|5}}==Ex 2==<div style="width: 400px; font-size:125%;"><pre>* '''Weight''': {{convert|oz|25}}</pre></div>Produces:* '''Weight''': {{convert|ozon|25}}==Ex 3==<div span style="widthdisplay: 400px; font-size:125%;none"><pre>* '''Barrel Length''': {{convert|in|5}}</pre></div>Produces:* '''Barrel Length'''padleft: {{convert|in|5}}==Ex 4==<div style="width: 400px; font-size:125%;"><pre>* '''Barrel Length'''FORMATNUM: {{convert|cm|25.{1}}</pre></div>Produces:* '''Barrel Length''': {{convert|cm|25.1}} ==Ex 5==If the parameter supplied is invalid (such as '''ccm''' no output will be displayed)<div style="width: 400px; font-size:125%;"><pre>* '''Barrel Length''': {{convert|ccm|25R}}</pre></div>Produces:* '''Barrel Length''': {{convert|ccm16|250}}  [[Category:Template]]<!-- ALL LINE BREAKS MUST BE REMOVED FOR TEMPLATE TO PROPERLY WORK!!!!! --></noinclude><includeonly><!-- kg to lbs -->{{#ifeq: {{{1}}}|kg|{{#expr: ({{{23|0}}}* 2.2046)round1*0}} lbs (|0|{{#exprpadleft: ({{FORMATNUM:{2{{3}}})round1|R}} kg)|16|0}}}}<!-- lbs to kg --/span>{{#ifeq: {{{1}}}|lbs|{{#expr: ({{{2}}})round1}} lbs (convert/{{#exprif: (1|{{{2}}}* 0.45359)round1}} kg)|}}<!-- oz to kg & lbs -->{{#ifeqFORMATNUM: {{{1}}}|ozR}}|{{#exprifeq: ({{{2}}}* 0.0625)round1}} lbs ({{#expr: ({{{23|0}}}* 0.0283495231)round1}} kg)|0|0}}<!-- g to kg & lbs -->|{{#ifeq: {{{13|}}}|g|{{#expr: ({{{24|}}}* 0.00220462262)round1}} lbs (|{{#expr: ({{{25|}}}* 0.001)round1}} kg)|}}<!-- in to cm-->{{#ifeq: {{{16|}}}|in|{{#expr: ({{{27|}}})round1}} in (|{{#expr: ({{{28|}}}* 2.54)round1}} cm)|}}<!-- cm to in-->r={{#ifeq: {{{1sp}}}|cmus|er|re}}|d=L{{#expr: ({{{2lk|off}}}* 0.393700787)round1}} in (A{{#expr: ({{{2abbr|off}}})round1}} cm)|}}<!-- mm to in & cm-->D{{#ifeq: {{{1disp|b}}}|mm|S{{#expr: ({adj|{{2{sing|off}}}* 0.0393700787)round1}} in (}|s={{#expr: ({{{2sigfig|}}}* 0.1)round1}} cm)|</includeonly><noinclude>{{Documentation}}</includeonlynoinclude>



Navigation menu