Changes

Jump to navigation Jump to search
m
replace template name in first sentence, it is shown in numbered list below
{{Documentation subpage}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->

This is one of three templates used to automatically add conversions of height measurements displayed by [[Template:Infobox person]] and other [[:Category:Infobox templates|infoboxes]] with a {{para|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 <code>&amp;nbsp;</code> 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

== Usage ==

[[Metre]]s:
* <code><nowiki>{{Infobox person/height|1 metre}}</nowiki></code> &rarr; {{Infobox person/height|1 metre}}
* <code><nowiki>{{Infobox person/height|1 meter}}</nowiki></code> &rarr; {{Infobox person/height|1 meter}}
* <code><nowiki>{{Infobox person/height|1.57 metres}}</nowiki></code> &rarr; {{Infobox person/height|1.57 metres}}
* <code><nowiki>{{Infobox person/height|1.57 meters}}</nowiki></code> &rarr; {{Infobox person/height|1.57 meters}}
* <code><nowiki>{{Infobox person/height|1.57 m}}</nowiki></code> &rarr; {{Infobox person/height|1.57 m}}
* <code><nowiki>{{Infobox person/height|1.57 ms}}</nowiki></code> &rarr; {{Infobox person/height|1.57 ms}}

[[Centimetre]]s:
* <code><nowiki>{{Infobox person/height|1 centimetre}}</nowiki></code> &rarr; {{Infobox person/height|1 centimetre}}
* <code><nowiki>{{Infobox person/height|1 centimeter}}</nowiki></code> &rarr; {{Infobox person/height|1 centimeter}}
* <code><nowiki>{{Infobox person/height|157 centimetres}}</nowiki></code> &rarr; {{Infobox person/height|157 centimetres}}
* <code><nowiki>{{Infobox person/height|157 centimeters}}</nowiki></code> &rarr; {{Infobox person/height|157 centimeters}}
* <code><nowiki>{{Infobox person/height|157 cm}}</nowiki></code> &rarr; {{Infobox person/height|157 cm}}
* <code><nowiki>{{Infobox person/height|157 cms}}</nowiki></code> &rarr; {{Infobox person/height|157 cms}}

[[Foot (unit)|Feet]]:
* <code><nowiki>{{Infobox person/height|1 foot}}</nowiki></code> &rarr; {{Infobox person/height|1 foot}}
* <code><nowiki>{{Infobox person/height|2 feet}}</nowiki></code> &rarr; {{Infobox person/height|2 feet}}
* <code><nowiki>{{Infobox person/height|2 ft}}</nowiki></code> &rarr; {{Infobox person/height|2 ft}}

[[Inch]]es:
* <code><nowiki>{{Infobox person/height|1 inch}}</nowiki></code> &rarr; {{Infobox person/height|1 inch}}
* <code><nowiki>{{Infobox person/height|2 inches}}</nowiki></code> &rarr; {{Infobox person/height|2 inches}}
* <code><nowiki>{{Infobox person/height|2 in}}</nowiki></code> &rarr; {{Infobox person/height|2 in}}
* <code><nowiki>{{Infobox person/height|2 ins}}</nowiki></code> &rarr; {{Infobox person/height|2 ins}}

[[Human height|Feet and inches]], embedded [[non-breaking space]], and text after height:
* <code><nowiki>{{Infobox person/height|5 feet 2 inches}}</nowiki></code> &rarr; {{Infobox person/height|5 feet 2 inches}}
* <code><nowiki>{{Infobox person/height|5feet 2inches}}</nowiki></code> &rarr; {{Infobox person/height|5feet 2inches}}
* <code><nowiki>{{Infobox person/height|5&amp;nbsp;feet 2&amp;nbsp;inches}}</nowiki></code> &rarr; {{Infobox person/height|5&nbsp;feet 2&nbsp;inches}}
* <code><nowiki>{{Infobox person/height|5 feet 2 inches (2012)}}</nowiki></code> &rarr; {{Infobox person/height|5 feet 2 inches (2012)}}

Embedded [[Help:Footnotes|footnotes (references)]]:
* <code><nowiki>{{Infobox person/height|5 feet 2 inches (2012)<ref>citation goes here</ref>}}</nowiki></code> &rarr; {{Infobox person/height|5 feet 2 inches (2012)<ref>citation goes here</ref>}}
* <code><nowiki>{{Infobox person/height|5 feet 2 inches (2012)<ref>"title". ''work''.</ref>}}</nowiki></code> &rarr; {{Infobox person/height|5 feet 2 inches (2012)<ref>"title". ''work''.</ref>}}
* <code><nowiki>{{Infobox person/height|5 feet 2 inches (2012)<ref>{{cite news|title=feet|work=inches}}</ref>}}</nowiki></code> &rarr; {{Infobox person/height|5 feet 2 inches (2012)<ref>{{cite news|title=feet|work=inches}}</ref>}}
* <code><nowiki>{{Infobox person/height|5 feet 2 inches (2012)<ref>{{citation|title=metres|work=centimetres}}</ref>}}</nowiki></code> &rarr; {{Infobox person/height|5 feet 2 inches (2012)<ref>{{citation|title=metres|work=centimetres}}</ref>}}
<references />

{{tl|Convert}} templates generating [[wikilink]]ed unit names:
* <code><nowiki>{{Infobox person/height|{{Convert|5|ft|2|in|lk=on|abbr=on}}}}</nowiki></code> &rarr; {{Infobox person/height|{{Convert|5|ft|2|in|lk=on|abbr=on}}}}
* <code><nowiki>{{Infobox person/height|{{Convert|5|ft|2|in|lk=on|abbr=off}}}}</nowiki></code> &rarr; {{Infobox person/height|{{Convert|5|ft|2|in|lk=on|abbr=off}}}}
* <code><nowiki>{{Infobox person/height|{{Convert|5|ft|2|in|cm|0|lk=on|abbr=on}}}}</nowiki></code> &rarr; {{Infobox person/height|{{Convert|5|ft|2|in|cm|0|lk=on|abbr=on}}}}
* <code><nowiki>{{Infobox person/height|{{Convert|5|ft|2|in|cm|0|lk=on|abbr=off}}}}</nowiki></code> &rarr; {{Infobox person/height|{{Convert|5|ft|2|in|cm|0|lk=on|abbr=off}}}}
* <code><nowiki>{{Infobox person/height|{{Convert|1.57|m|lk=on|abbr=on}}}}</nowiki></code> &rarr; {{Infobox person/height|{{Convert|1.57|m|lk=on|abbr=on}}}}
* <code><nowiki>{{Infobox person/height|{{Convert|1.57|m|lk=on|abbr=off}}}}</nowiki></code> &rarr; {{Infobox person/height|{{Convert|1.57|m|lk=on|abbr=off}}}}
* <code><nowiki>{{Infobox person/height|{{Convert|157|cm|ftin|lk=on|abbr=on}}}}</nowiki></code> &rarr; {{Infobox person/height|{{Convert|157|cm|ftin|lk=on|abbr=on}}}}
* <code><nowiki>{{Infobox person/height|{{Convert|157|cm|ftin|lk=on|abbr=off}}}}</nowiki></code> &rarr; {{Infobox person/height|{{Convert|157|cm|ftin|lk=on|abbr=off}}}}

== Exceptions ==

Does not replace numbers in manually entered conversions, but does replace unit names with abbreviations (examples intentionally show incorrect conversions):

* <code><nowiki>{{Infobox person/height|5 feet 2 inches (1.00 metres)}}</nowiki></code> &rarr; {{Infobox person/height|5 feet 2 inches (1.00 metres)}}
* <code><nowiki>{{Infobox person/height|5 feet 2 inches (100 centimetres)}}</nowiki></code> &rarr; {{Infobox person/height|5 feet 2 inches (100 centimetres)}}
* <code><nowiki>{{Infobox person/height|1.57 metres (5 feet 5 inches)}}</nowiki></code> &rarr; {{Infobox person/height|1.57 metres (5 feet 5 inches)}}
* <code><nowiki>{{Infobox person/height|157 centimetres (5 feet 5 inches)}}</nowiki></code> &rarr; {{Infobox person/height|157 centimetres (5 feet 5 inches)}}

Does not replace numeric output of conversion templates such as {{tl|convert}} or {{tl|height}}, but does replace unit names with abbreviations (examples have different precision than usual):

* <code><nowiki>{{Infobox person/height|{{Convert|5|ft|2|in|m|3|abbr=off}}}}</nowiki></code> &rarr; {{Infobox person/height|{{Convert|5|ft|2|in|m|3|abbr=off}}}}
** output of convert template: {{Convert|5|ft|2|in|m|3|abbr=off}}
* <code><nowiki>{{Infobox person/height|{{Convert|5|ft|2|in|cm|sigfig=4|abbr=off}}}}</nowiki></code> &rarr; {{Infobox person/height|{{Convert|5|ft|2|in|cm|sigfig=4|abbr=off}}}}
** output of convert template: {{Convert|5|ft|2|in|cm|sigfig=4|abbr=off}}
* <code><nowiki>{{Infobox person/height|{{Convert|1.57|m|ftin|1|abbr=off}}}}</nowiki></code> &rarr; {{Infobox person/height|{{Convert|1.57|m|ftin|1|abbr=off}}}}
** output of convert template: {{Convert|1.57|m|ftin|1|abbr=off}}
* <code><nowiki>{{Infobox person/height|{{Convert|157|cm|ftin|1|abbr=off}}}}</nowiki></code> &rarr; {{Infobox person/height|{{Convert|157|cm|ftin|1|abbr=off}}}}
** output of convert template: {{Convert|157|cm|ftin|1|abbr=off}}
* <code><nowiki>{{Infobox person/height|{{Height|m=1.57|frac=4|abbr=no}}}}</nowiki></code> &rarr; {{Infobox person/height|{{Height|m=1.57|frac=4|abbr=no}}}}
** output of convert template: {{Height|m=1.57|frac=4|abbr=no}}
* <code><nowiki>{{Infobox person/height|{{Height|cm=157|frac=4|abbr=no}}}}</nowiki></code> &rarr; {{Infobox person/height|{{Height|cm=157|frac=4|abbr=no}}}}
** output of convert template: {{Height|cm=157|frac=4|abbr=no}}

Period at end of abbreviation displays after the conversion:

* <code><nowiki>{{Infobox person/height|1.52 m.}}</nowiki></code> &rarr; {{Infobox person/height|1.52 m.}}
* <code><nowiki>{{Infobox person/height|152 cm.}}</nowiki></code> &rarr; {{Infobox person/height|152 cm.}}
* <code><nowiki>{{Infobox person/height|5 ft.}}</nowiki></code> &rarr; {{Infobox person/height|5 ft.}}
* <code><nowiki>{{Infobox person/height|60 in.}}</nowiki></code> &rarr; {{Infobox person/height|60 in.}}
* <code><nowiki>{{Infobox person/height|5 ft 0 in.}}</nowiki></code> &rarr; {{Infobox person/height|5 ft 0 in.}}

Multiple unit conversions won't work if input contains periods or commas:

* <code><nowiki>{{Infobox person/height|5 ft. 2 in}}</nowiki></code> &rarr; {{Infobox person/height|5 ft. 2 in}}
* <code><nowiki>{{Infobox person/height|5 ft, 2 in}}</nowiki></code> &rarr; {{Infobox person/height|5 ft, 2 in}}

Does not recognize symbols for feet and inches:

* <code><nowiki>{{Infobox person/height|5' 2"}}</nowiki></code> &rarr; {{Infobox person/height|5' 2"}}
* <code><nowiki>{{Infobox person/height|5′ 2″}}</nowiki></code> &rarr; {{Infobox person/height|5′ 2″}}
* <code><nowiki>{{Infobox person/height|157cm (5' 2")}}</nowiki></code> &rarr; {{Infobox person/height|157cm (5' 2")}}
* <code><nowiki>{{Infobox person/height|157cm (5′ 2″)}}</nowiki></code> &rarr; {{Infobox person/height|157cm (5′ 2″)}}
* <code><nowiki>{{Infobox person/height|1.57m (5' 2")}}</nowiki></code> &rarr; {{Infobox person/height|1.57m (5' 2")}}
* <code><nowiki>{{Infobox person/height|1.57m (5′ 2″)}}</nowiki></code> &rarr; {{Infobox person/height|1.57m (5′ 2″)}}

== See also ==
* [[Template:Infobox person]]
* [[Template:Infobox person/weight]]
** [[Template:Infobox person/weight/locate]]
** [[Template:Infobox person/weight/switch]]
* [[Template:Infobox person/length]]
** [[Template:Infobox person/length/locate]]
** [[Template:Infobox person/length/switch]]

<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Template implementation details]]

}}</includeonly>
Anonymous user

Navigation menu