Jump to content

ଛାଞ୍ଚ:Infobox person/length/locate/doc

ଉଇକିପିଡ଼ିଆ‌ରୁ

ଛାଞ୍ଚ:Infobox person/length/locate is one of three templates used to automatically add conversions of length measurements displayed by infoboxes, such as the |reach= parameter in {{Infobox boxer}}.

  1. Template:Infobox person/length changes text for units of length to the abbreviations "cm" or "in", then passes the string to:
  2. Template:Infobox person/length/locate which replaces any instances of   with a space, and determines the positions of "cm" or "in" within that string, all of which is passed to:
  3. Template:Infobox person/length/switch which does the conversion


Does not replace numbers in hard-coded conversions (examples intentionally show incorrect conversions):

Does not replace numeric output of conversion templates such as {{convert}} (examples have precision different than usual):

Technical details

[ସମ୍ପାଦନା]

The following example shows how the template works:

{{Infobox person/length/switch
  |{{{1|198 cm}}}
  |{{#invoke:String|replace|{{{1|198 cm}}}| | }}
  |c={{#invoke:String|find|{{#invoke:String|replace|{{{1|198 cm}}}| | }}|cm}}
  |i={{#invoke:String|find|{{#invoke:String|replace|{{{1|198 cm}}}| | }}|in}}
}}

Result:
{{Infobox person/length/switch |198 cm |198 cm |c=5 |i=0 }}