Template:CHeight: Difference between revisions

You may be wondering what this template does. Well, now it'll tell you!
(overly complex template go!)
 
(You may be wondering what this template does. Well, now it'll tell you!)
Line 1: Line 1:
<includeonly>{{#switch: {{{2|}}}|
<includeonly>{{#switch: {{{1|}}}|
|Imperial = {{#expr: floor({{{1|}}}/12)}}' {{#expr: {{{1|}}} - (floor({{{1|}}}/12)*12)}} ({{#expr: {{{1|}}}*2.54 round 2}}cm)
|Imperial = {{#expr: floor({{{2|}}}/12)}}' {{#expr: {{{2|}}} - (floor({{{2|}}}/12)*12)}} ({{#expr: {{{2|}}}*2.54 round 2}}cm)
|Metric = {{{1|}}} cm ({{#expr:floor(#expr: {{{1|}}}/2.54 round 0)/12)}}' {{#expr:floor(#expr: {{{1|}}}/2.54 round 0)/12) - floor(#expr: {{{1|}}}/2.54 round 0)/12)*12}} in)
|Metric = {{{2|}}} cm ({{#expr:floor(#expr: {{{2|}}}/2.54 round 0)/12)}}' {{#expr:floor(#expr: {{{2|}}}/2.54 round 0)/12) - floor(#expr: {{{2|}}}/2.54 round 0)/12)*12}} in)
|{{{1}}}
|Parameter 1: {{{1}}}, Parameter 2: {{{2}}}
}}</includeonly>
}}</includeonly><noinclude>This template calculates height from given parameters and formats. Ex: <nowiki>{{CHeight|Imperial|69}}</nowiki> produces {{CHeight|Imperial|69}}</noinclude>
7,850

edits