Template:Infobox npc/height/doc

From Anarchy Online Wiki [AOWiki]

{{#ifeq:doc |doc

    | 

{{#ifeq:show |show

|

        }}{{#if: |
         |   {{#ifexist:Template:Infobox npc/height
                  | [[Category:{{#switch:Template |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
                  |
                 }}
        }}
    | 
   }}

Template:Infobox npc/height is one of three templates used to automatically add conversions of height measurements displayed by Template:Infobox person and other infoboxes with a |{{#if:height|height=}} parameter.

  1. Template:Infobox person/height changes text for units of height to the abbreviations "m", "cm", "ft", or "in", then passes the string to:
  2. 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:
  3. Template:Infobox person/height/switch which does the conversion

Usage[edit]

Metres:

Centimetres:

Feet:

Inches:

Feet and inches, embedded non-breaking space, and text after height:

Embedded footnotes (references):

<references />

{{Convert}} templates generating wikilinked unit names:

Exceptions[edit]

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

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

  • {{Infobox person/height|{{Convert|5|ft|2|in|m|3|abbr=off}}}}Template:Infobox person/height
    • output of convert template: 5 feet 2 inches (1.575 metres)
  • {{Infobox person/height|{{Convert|1.57|m|ftin|1|abbr=off}}}}Template:Infobox person/height
    • output of convert template: 1.57 metres (5 feet 1.8 inches)
  • {{Infobox person/height|{{Height|ft=5|in=2|precision=3|abbr=no}}}}Template:Infobox person/height
    • output of convert template: {{#switch:{{#if:|1|0}}{{#if:|1|0}}{{#if:5|1|0}}{{#if:2|1|0}}

|1000=[convert: needs a number] |0100=[convert: invalid number] |0011=5 feet 2 inches ([convert: unknown unit])* |0010=5 feet 0 inches ([convert: unknown unit])* |0001=0 feet 2 inches ([convert: unknown unit])* |0000= |#default=Error: please specify height using only one type of units }}

  • {{Infobox person/height|{{Height|m=1.57|frac=4|abbr=no}}}}Template:Infobox person/height
    • output of convert template: {{#switch:{{#if:|1|0}}{{#if:1.57|1|0}}{{#if:|1|0}}{{#if:|1|0}}

|1000=[convert: needs a number] |0100=1.57 metres (5 ft 1.8 in)* |0011=[convert: needs a number] |0010=[convert: needs a number] |0001=[convert: needs a number] |0000= |#default=Error: please specify height using only one type of units }}

Period at end of abbreviation displays after the conversion:

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

Does not recognize symbols for feet and inches:

See also[edit]