Template:CHeight: Difference between revisions
Jump to navigation
Jump to search
(You may be wondering what this template does. Well, now it'll tell you!) |
(testing out other example. Added in metric example.) |
||
Line 1: | Line 1: | ||
<includeonly>{{#switch: {{{1|}}}| | <includeonly>{{#switch: {{{1|}}}| | ||
|Imperial = {{#expr: floor({{{2|}}}/12)}}' {{#expr: {{{2|}}} - (floor({{{2|}}}/12)*12)}} ({{#expr: {{{2|}}}*2.54 round 2}}cm) | |Imperial = {{#expr: floor({{{2|}}}/12)}}' {{#expr: {{{2|}}} - (floor({{{2|}}}/12)*12)}} ({{#expr: {{{2|}}}*2.54 round 2}}cm) | ||
|Metric = {{{2|}}} cm ({{#expr:floor( | |Metric = {{{2|}}} cm ({{#expr:floor({{{2|}}}/2.54 round 0)/12)}}' {{#expr:floor({{{2|}}}/2.54 round 0)/12) - floor({{#expr: {{{2|}}}/2.54 round 0)/12)*12}} in) | ||
|Parameter 1: {{{1}}}, Parameter 2: {{{2}}} | |Parameter 1: {{{1}}}, Parameter 2: {{{2}}} | ||
}}</includeonly><noinclude>This template calculates height from given parameters and formats. Ex: <nowiki>{{CHeight|Imperial|69}}</nowiki> produces {{CHeight|Imperial|69}}</noinclude> | }}</includeonly><noinclude>This template calculates height from given parameters and formats. Ex: <nowiki>{{CHeight|Imperial|69}}</nowiki> produces {{CHeight|Imperial|69}} and <nowiki>{{CHeight|Metric|175.26}}</nowiki> produces {{CHeight|Metric|175.26}} </noinclude> |
Revision as of 18:33, 9 March 2015
This template calculates height from given parameters and formats. Ex: {{CHeight|Imperial|69}} produces {{#switch: Imperial| |Imperial = 5' 9 (175.26cm) |Metric = 69 cm (Expression error: Unexpected closing bracket.' Expression error: Unexpected closing bracket. and {{CHeight|Metric|175.26}} produces {{#switch: Metric| |Imperial = 14' 7.26 (445.16cm) |Metric = 175.26 cm (Expression error: Unexpected closing bracket.' Expression error: Unexpected closing bracket.