Template:CHeight: Difference between revisions

From 118Wiki
Jump to navigation Jump to search
(added in " formatting, rewrote Metric code to be a bit simplier. (12*2.54= 30.48))
(missing }, removed " from top line.)
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({{{2|}}}/30.48)}}' {{#expr:{{{2|}}/2.54 - floor({{{2|}}/30.48}})}}")
|Metric = {{{2|}}} cm ({{#expr:floor({{{2|}}}/30.48)}}' {{#expr:{{{2|}}}/2.54 - floor({{{2|}}}/30.48}})}}")
|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}} and <nowiki>{{CHeight|Metric|175.26}}</nowiki> produces {{CHeight|Metric|175.26}} </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:43, 9 March 2015

This template calculates height from given parameters and formats. Ex: {{CHeight|Imperial|69}} produces 5' 9 (175.26cm)") |Parameter 1: Imperial, Parameter 2: 69 }} and {{CHeight|Metric|175.26}} produces 175.26 cm (5' Expression error: Unclosed bracket.)") |Parameter 1: Metric, Parameter 2: 175.26 }}