Error creating thumbnail: File missing Join our Discord! |
If you have been locked out of your account you can request a password reset here. |
Template:Convert: Difference between revisions
Zackmann08 (talk | contribs) |
Zackmann08 (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
< | This tempalte allows for an easy way to convert units. To use the template place <nowiki>{{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= | =Examples= | ||
==Ex 1== | ==Ex 1== | ||
Line 30: | Line 26: | ||
Produces: | Produces: | ||
* '''Barrel Length''': {{convert|cm|25}} | * '''Barrel Length''': {{convert|cm|25}} | ||
==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|25}} | |||
</pre></div> | |||
Produces: | |||
* '''Barrel Length''': {{convert|ccm|25}} | |||
[[Category:Templates]] | [[Category:Templates]] | ||
<!-- ALL LINE BREAKS MUST BE REMOVED FOR TEMPLATE TO PROPERLY WORK!!!!! --> | <!-- ALL LINE BREAKS MUST BE REMOVED FOR TEMPLATE TO PROPERLY WORK!!!!! --> | ||
</noinclude><includeonly><!-- kg to lbs -->{{#ifeq: {{{1}}}|kg|{{#expr: ({{{2}}}* 2.2046)round2}} lbs ({{{2}}} kg)|}}<!-- lbs to kg -->{{#ifeq: {{{1}}}|lbs|{{{2}}} lbs ({{#expr: ({{{2}}}* 0.45359)round2}} kg)|}}<!-- oz to kg & lbs -->{{#ifeq: {{{1}}}|oz|{{#expr: ({{{2}}}* 0.0625)round2}} lbs ({{#expr: ({{{2}}}* 0.0283495231)round2}} kg)|}}<!-- g to kg & lbs -->{{#ifeq: {{{1}}}|g|{{#expr: ({{{2}}}* 0.00220462262)round2}} lbs ({{#expr: ({{{2}}}* 0.001)round2}} kg)|}}<!-- in to cm-->{{#ifeq: {{{1}}}|in|{{{2}}} in ({{#expr: ({{{2}}}* 2.54)round2}} cm)|}}<!-- cm to in-->{{#ifeq: {{{1}}}|cm|{{#expr: ({{{2}}}* 0.393700787)round2}} in ({{{2}}} cm)|}}<!-- mm to in & cm-->{{#ifeq: {{{1}}}|g|{{#expr: ({{{2}}}* 0.0393700787)round2}} in ({{#expr: ({{{2}}}* 0.1)round2}} cm)|}}</includeonly> | </noinclude><includeonly><!-- kg to lbs -->{{#ifeq: {{{1}}}|kg|{{#expr: ({{{2}}}* 2.2046)round2}} lbs ({{{2}}} kg)|}}<!-- lbs to kg -->{{#ifeq: {{{1}}}|lbs|{{{2}}} lbs ({{#expr: ({{{2}}}* 0.45359)round2}} kg)|}}<!-- oz to kg & lbs -->{{#ifeq: {{{1}}}|oz|{{#expr: ({{{2}}}* 0.0625)round2}} lbs ({{#expr: ({{{2}}}* 0.0283495231)round2}} kg)|}}<!-- g to kg & lbs -->{{#ifeq: {{{1}}}|g|{{#expr: ({{{2}}}* 0.00220462262)round2}} lbs ({{#expr: ({{{2}}}* 0.001)round2}} kg)|}}<!-- in to cm-->{{#ifeq: {{{1}}}|in|{{{2}}} in ({{#expr: ({{{2}}}* 2.54)round2}} cm)|}}<!-- cm to in-->{{#ifeq: {{{1}}}|cm|{{#expr: ({{{2}}}* 0.393700787)round2}} in ({{{2}}} cm)|}}<!-- mm to in & cm-->{{#ifeq: {{{1}}}|g|{{#expr: ({{{2}}}* 0.0393700787)round2}} in ({{#expr: ({{{2}}}* 0.1)round2}} cm)|}}</includeonly> |
Revision as of 03:41, 3 May 2012
This tempalte allows for an easy way to convert units. To use the template place {{convert|Value 1|Value 2}} 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
* '''Weight''': {{convert|kg|5}}
Produces:
- Weight: This tempalte allows for an easy way to convert units. To use the template place {{convert|Value 1|Value 2}}
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
* '''Weight''': {{convert|kg|5}}
Produces:
- Weight: Template loop detected: Template:Convert
Ex 2
* '''Weight''': {{convert|oz|25}}
Produces:
- Weight: Template loop detected: Template:Convert
Ex 3
* '''Barrel Length''': {{convert|in|5}}
Produces:
- Barrel Length: Template loop detected: Template:Convert
Ex 4
* '''Barrel Length''': {{convert|cm|25}}
Produces:
- Barrel Length: Template loop detected: Template:Convert
Ex 5
If the parameter supplied is invalid (such as ccm no output will be displayed)
* '''Barrel Length''': {{convert|ccm|25}}
Produces:
- Barrel Length: Template loop detected: Template:Convert
</noinclude>11.02 lbs (5 kg)
Ex 2
* '''Weight''': {{convert|oz|25}}
Produces:
- Weight: This tempalte allows for an easy way to convert units. To use the template place {{convert|Value 1|Value 2}}
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
* '''Weight''': {{convert|kg|5}}
Produces:
- Weight: Template loop detected: Template:Convert
Ex 2
* '''Weight''': {{convert|oz|25}}
Produces:
- Weight: Template loop detected: Template:Convert
Ex 3
* '''Barrel Length''': {{convert|in|5}}
Produces:
- Barrel Length: Template loop detected: Template:Convert
Ex 4
* '''Barrel Length''': {{convert|cm|25}}
Produces:
- Barrel Length: Template loop detected: Template:Convert
Ex 5
If the parameter supplied is invalid (such as ccm no output will be displayed)
* '''Barrel Length''': {{convert|ccm|25}}
Produces:
- Barrel Length: Template loop detected: Template:Convert
</noinclude>1.56 lbs (0.71 kg)
Ex 3
* '''Barrel Length''': {{convert|in|5}}
Produces:
- Barrel Length: This tempalte allows for an easy way to convert units. To use the template place {{convert|Value 1|Value 2}}
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
* '''Weight''': {{convert|kg|5}}
Produces:
- Weight: Template loop detected: Template:Convert
Ex 2
* '''Weight''': {{convert|oz|25}}
Produces:
- Weight: Template loop detected: Template:Convert
Ex 3
* '''Barrel Length''': {{convert|in|5}}
Produces:
- Barrel Length: Template loop detected: Template:Convert
Ex 4
* '''Barrel Length''': {{convert|cm|25}}
Produces:
- Barrel Length: Template loop detected: Template:Convert
Ex 5
If the parameter supplied is invalid (such as ccm no output will be displayed)
* '''Barrel Length''': {{convert|ccm|25}}
Produces:
- Barrel Length: Template loop detected: Template:Convert
</noinclude>5 in (12.7 cm)
Ex 4
* '''Barrel Length''': {{convert|cm|25}}
Produces:
- Barrel Length: This tempalte allows for an easy way to convert units. To use the template place {{convert|Value 1|Value 2}}
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
* '''Weight''': {{convert|kg|5}}
Produces:
- Weight: Template loop detected: Template:Convert
Ex 2
* '''Weight''': {{convert|oz|25}}
Produces:
- Weight: Template loop detected: Template:Convert
Ex 3
* '''Barrel Length''': {{convert|in|5}}
Produces:
- Barrel Length: Template loop detected: Template:Convert
Ex 4
* '''Barrel Length''': {{convert|cm|25}}
Produces:
- Barrel Length: Template loop detected: Template:Convert
Ex 5
If the parameter supplied is invalid (such as ccm no output will be displayed)
* '''Barrel Length''': {{convert|ccm|25}}
Produces:
- Barrel Length: Template loop detected: Template:Convert
</noinclude>9.84 in (25 cm)
Ex 5
If the parameter supplied is invalid (such as ccm no output will be displayed)
* '''Barrel Length''': {{convert|ccm|25}}
Produces:
- Barrel Length: This tempalte allows for an easy way to convert units. To use the template place {{convert|Value 1|Value 2}}
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
* '''Weight''': {{convert|kg|5}}
Produces:
- Weight: Template loop detected: Template:Convert
Ex 2
* '''Weight''': {{convert|oz|25}}
Produces:
- Weight: Template loop detected: Template:Convert
Ex 3
* '''Barrel Length''': {{convert|in|5}}
Produces:
- Barrel Length: Template loop detected: Template:Convert
Ex 4
* '''Barrel Length''': {{convert|cm|25}}
Produces:
- Barrel Length: Template loop detected: Template:Convert
Ex 5
If the parameter supplied is invalid (such as ccm no output will be displayed)
* '''Barrel Length''': {{convert|ccm|25}}
Produces:
- Barrel Length: Template loop detected: Template:Convert
</noinclude>