Difference between revisions of "Template:Infobox person/height/switch/sandbox"
< Template:Infobox person | height | switch
Jump to navigation
Jump to search
imported>Zyxw (test) |
imported>Zyxw (copy of current template) |
||
| Line 1: | Line 1: | ||
| − | {{ | + | {{#switch:0 |
|{{{m}}}{{{f}}}{{{i}}}={{{1|}}} | |{{{m}}}{{{f}}}{{{i}}}={{{1|}}} | ||
| − | |{{{f}}}{{{i}}}={{ | + | |{{{f}}}{{{i}}}={{#ifeq:{{{c}}}|0 |
| − | |{{ | + | |{{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{m|1}}}-1}}}}}} |
|{{{1|}}} | |{{{1|}}} | ||
| − | |{{ | + | |{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{m|1}}}-1}}}}|m|ftin|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{m|1}}}+1}}}} |
}} | }} | ||
| − | |{{ | + | |{{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{c|1}}}-1}}}}}} |
|{{{1|}}} | |{{{1|}}} | ||
| − | |{{ | + | |{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{c|1}}}-1}}}}|cm|ftin|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{m|1}}}+1}}}} |
}} | }} | ||
}} | }} | ||
| − | |{{{m}}}{{{f}}}={{ | + | |{{{m}}}{{{f}}}={{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{i|1}}}-1}}}}}} |
|{{{1|}}} | |{{{1|}}} | ||
| − | |{{ | + | |{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{i|1}}}-1}}}}|in|cm|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{i|1}}}+2}}}} |
}} | }} | ||
| − | |{{{m}}}{{{i}}}={{ | + | |{{{m}}}{{{i}}}={{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{f|1}}}-1}}}}}} |
|{{{1|}}} | |{{{1|}}} | ||
| − | |{{ | + | |{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{f|1}}}-1}}}}|ft|cm|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{f|1}}}+2}}}} |
}} | }} | ||
| − | |{{{m}}}={{ | + | |{{{m}}}={{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{f|1}}}-1}}}}+{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{f|1}}}+2}}|{{#expr:{{{i|1}}}-1}}}}}} |
|{{{1|}}} | |{{{1|}}} | ||
| − | |{{ | + | |{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{f|1}}}-1}}}}|ft|{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{f|1}}}+2}}|{{#expr:{{{i|1}}}-1}}}}|in|cm|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{i|1}}}+2}}}} |
}} | }} | ||
|{{{1|}}} | |{{{1|}}} | ||
Latest revision as of 14:15, 18 February 2019
| This is the template sandbox page for Template:Infobox person/height/switch (diff). |
This is one of three templates used to automatically add conversions of height measurements displayed by Template:Infobox person and other infoboxes with a |height= parameter.
- Template:Infobox person/height changes text for units of height to the abbreviations "m", "cm", "ft", or "in", then passes the string to:
- Template:Infobox person/height/locate which replaces any instances of
with a space, and determines the positions of "m", "cm", "ft", or "in" within that string, all of which is passed to: - Template:Infobox person/height/switch which does the conversion
See also
| The above documentation is transcluded from Template:Infobox person/height/switch/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |