Template:Measurements length/doc
Jump to navigation
Jump to search
| This is a documentation subpage for Template:Measurements length. It contains usage information, categories and other content that is not part of the original template page. |
Template:Measurements length is one of three templates used to automatically add conversions of length measurements displayed by bioboxes, such as the para|reach parameter in biobox.
- Template:Measurements length changes text for units of length to the abbreviations "cm" or "in", then passes the string to:
- Template:Measurements 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: - Template:Measurements length/switch which does the conversion
Usage
[edit source]cm
[edit source]{{Measurements length|1 centimetre}}→ 1 cm (0 in){{Measurements length|1 centimeter}}→ 1 cm (0 in){{Measurements length|198 centimetres}}→ 198 cm (78 in){{Measurements length|198 centimeters}}→ 198 cm (78 in){{Measurements length|198 cm}}→ 198 cm (78 in){{Measurements length|198 cm.}}→ 198 cm (78 in){{Measurements length|198 cms}}→ 198 cm (78 in)
in
[edit source]{{Measurements length|1 inch}}→ 1 in (3 cm){{Measurements length|78 inches}}→ 78 in (198 cm){{Measurements length|78 in}}→ 78 in (198 cm){{Measurements length|78 in.}}→ 78 in (198 cm){{Measurements length|78 ins}}→ 78 in (198 cm)
no space or
[edit source]{{Measurements length|198centimetres}}→ 198 cm (78 in){{Measurements length|78 inches}}→ 78 in (198 cm)
year and reference
[edit source]{{Measurements length|198 cms (2012)}}→ 198 cm (78 in) (2012){{Measurements length|78 ins (2012)<ref>citation goes here</ref>}}→ 78 in (198 cm) (2012)[1]
- ↑ citation goes here
conversion templates
[edit source]{{Measurements length|{{convert|198|cm|in|0}}}}→ 198 cm (78 in){{Measurements length|{{convert|78|in|cm|0}}}}→ 78 in (198 cm)
Exceptions
[edit source]Does not replace numbers in hard-coded conversions (examples intentionally show incorrect conversions), but does replace units with abbreviations "cm or "in":
{{Measurements length|198 centimetres (71 inches)}}→ 198 cm (71 in){{Measurements length|78 inches (191 centimeters)}}→ 78 in (191 cm)
Does not replace numeric output of conversion templates such as {{convert}} (examples have precision different than usual), but does replace units with abbreviations "cm or "in":
{{Measurements length|{{convert|198|cm|in|2|abbr=off}}}}→ 198 cm (77.95 in)- compare to:
{{convert|198|cm|in|2|abbr=off}}→ 198 centimetres (77.95 inches)
- compare to:
{{Measurements length|{{convert|78|in|cm|1|abbr=off|sp=us}}}}→ 78 in (198.1 cm)- compare to:
{{convert|78|in|cm|1|abbr=off|sp=us}}→ 78 inches (198.1 centimeters)
- compare to:
Does not recognize {{convert}} template with conversion to metres (adds conversion to centimetres):
{{Measurements length|{{convert|78|in|m|2|abbr=on}}}}→ 78 in (198 cm) (1.98 m)- compare to:
{{convert|78|in|m|2|abbr=on}}→ 78 in (1.98 m)
- compare to:
Does not convert meters/metres (m), feet (ft), yards (yd), etc.:
{{Measurements length|5 metres}}→ 5 metres{{Measurements length|5 meters}}→ 5 meters{{Measurements length|5 m}}→ 5 m{{Measurements length|5 feet}}→ 5 feet{{Measurements length|5 ft}}→ 5 ft{{Measurements length|5 yards}}→ 5 yards{{Measurements length|5 yd}}→ 5 yd