This is one of three templates used to automatically add conversions of length measurements displayed by infoboxes, such as the |reach= parameter in {{Infobox boxer}} or the |spike= and |block= parameters in {{Infobox volleyball biography}}.

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

Usageসম্পাদনা

  • {{Template:Infobox person/length/locate|198 cm}} → ১৯৮ সেমি (৭৮ ইঞ্চি)
  • {{Template:Infobox person/length/locate|198 cm}} → ১৯৮ সেমি (৭৮ ইঞ্চি)
  • {{Template:Infobox person/length/locate|78 in}} → 78 in
  • {{Template:Infobox person/length/locate|78 in}} → 78 in
  • {{Template:Infobox person/length/locate|198 cm (2012)}} → ১৯৮ সেমি (৭৮ ইঞ্চি) (2012)
  • {{Template:Infobox person/length/locate|78&nbsp;in (2012)<ref>citation goes here</ref>}} → 78 in (2012)[১]
  1. citation goes here

Exceptionsসম্পাদনা

Does not replace numbers in manually entered conversions (examples intentionally show incorrect conversions):

  • {{Template:Infobox person/length/locate|198 cm (71 in)}} → 198 cm (71 in)
  • {{Template:Infobox person/length/locate|1.98 m (71 in)}} → 1.98 m (71 in)
  • {{Template:Infobox person/length/locate|78 in (191 cm)}} → 78 in (191 cm)
  • {{Template:Infobox person/length/locate|78 in (1.91 m)}} → 78 in (1.91 m)

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

  • {{Template:Infobox person/length/locate|{{convert|198|cm|in|2|abbr=on}}}} → ১৯৮ সেমি (৭৭.৯৫ ইঞ্চি)
  • {{Template:Infobox person/length/locate|{{convert|1.98|m|in|2|abbr=on}}}} → ১.৯৮ মি (৭৭.৯৫ ইঞ্চি)
  • {{Template:Infobox person/length/locate|{{convert|78|in|cm|1|abbr=on}}}} → ৭৮ ইঞ্চি (১৯৮.১ সেমি)
  • {{Template:Infobox person/length/locate|{{convert|78|in|m|3|abbr=on}}}} → ৭৮ ইঞ্চি (১.৯৮১ মি)

Technical detailsসম্পাদনা

The following examples show how the template works:

cmসম্পাদনা

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

Result:
{{Infobox person/length/switch |198&nbsp;cm |198 cm |c=5 |m=6 |i=0 }}

১৯৮ সেমি (৭৮ ইঞ্চি)

mসম্পাদনা

{{Infobox person/length/switch
  |{{{1|1.98&nbsp;m}}}
  |{{#invoke:String|replace|{{{1|1.98&nbsp;m}}}|&nbsp;| }}
  |c={{#invoke:String|find|{{#invoke:String|replace|{{{1|1.98&nbsp;m}}}|&nbsp;| }}|cm}}
  |m={{#invoke:String|find|{{#invoke:String|replace|{{{1|1.98&nbsp;m}}}|&nbsp;| }}|m}}
  |i={{#invoke:String|find|{{#invoke:String|replace|{{{1|1.98&nbsp;m}}}|&nbsp;| }}|in}}
}}

Result:
{{Infobox person/length/switch |1.98&nbsp;m |1.98 m |c=0 |m=6 |i=0 }}

১.৯৮ মি (৭৮ ইঞ্চি)

inসম্পাদনা

{{Infobox person/length/switch
  |{{{1|78&nbsp;in}}}
  |{{#invoke:String|replace|{{{1|78&nbsp;in}}}|&nbsp;| }}
  |c={{#invoke:String|find|{{#invoke:String|replace|{{{1|78&nbsp;in}}}|&nbsp;| }}|cm}}
  |m={{#invoke:String|find|{{#invoke:String|replace|{{{1|78&nbsp;in}}}|&nbsp;| }}|m}}
  |i={{#invoke:String|find|{{#invoke:String|replace|{{{1|78&nbsp;in}}}|&nbsp;| }}|in}}
}}

Result:
{{Infobox person/length/switch |78&nbsp;in |78 in |c=0 |m=0 |i=4 }}

৭৮ ইঞ্চি (১৯৮ সেমি)

See alsoসম্পাদনা