แม่แบบ:Infobox person/height
| แม่แบบนี้ใช้ในแม่แบบ สำหรับบทความโปรดใช้ {{Convert}} หรือ {{Height}} |
| แม่แบบนี้ใช้ลูอา |
This template is used to automatically add conversions of height measurements displayed by Template:Infobox person and other infoboxes with a |height= parameter.
การใช้งาน
[แก้]{{Infobox
...
| label# = Height
| data# = {{#if: {{{height|}}} | {{Infobox person/height|{{{height}}}}} }}
...
}}
ตัวอย่าง
[แก้]|height=1 centimetre→ 1 เซนติเมตร (0 นิ้ว)|height=1centimeter→ 1 เซนติเมตร (0 นิ้ว)|height=1 centimeter→ 1 เซนติเมตร (0 นิ้ว)|height=157 centimetres→ 157 เซนติเมตร (5 ฟุต 2 นิ้ว)|height=157 centimeters→ 157 เซนติเมตร (5 ฟุต 2 นิ้ว)|height=157 cms→ 157 เซนติเมตร (5 ฟุต 2 นิ้ว)|height=157 cm.→ 157 เซนติเมตร (5 ฟุต 2 นิ้ว)
เมตร:
|height=1 metre→ 1 เมตร (3 ฟุต 3 นิ้ว)|height=1meter→ 1 เมตร (3 ฟุต 3 นิ้ว)|height=1 meter→ 1 เมตร (3 ฟุต 3 นิ้ว)|height=1.57 metres→ 1.57 เมตร (5 ฟุต 2 นิ้ว)|height=1.57 meters→ 1.57 เมตร (5 ฟุต 2 นิ้ว)|height=1.57 ms→ 1.57 เมตร (5 ฟุต 2 นิ้ว)|height=1.57 m.→ 1.57 เมตร (5 ฟุต 2 นิ้ว)
ฟุต:
|height=1 foot→ 1 ฟุต (30 เซนติเมตร)|height=1foot→ 1 ฟุต (30 เซนติเมตร)|height=1 foot→ 1 ฟุต (30 เซนติเมตร)|height=2 feet→ 2 ฟุต (61 เซนติเมตร)|height=2 ft.→ 2 ฟุต (61 เซนติเมตร)
นิ้ว:
|height=1 inch→ 1 นิ้ว (3 เซนติเมตร)|height=1inch→ 1 นิ้ว (3 เซนติเมตร)|height=1 inch→ 1 นิ้ว (3 เซนติเมตร)|height=2 inches→ 2 นิ้ว (5 เซนติเมตร)|height=2 ins→ 2 นิ้ว (5 เซนติเมตร)|height=2 in.→ 2 นิ้ว (5 เซนติเมตร)
|height=5 feet 2 inches→ 5 ฟุต 2 นิ้ว (157 เซนติเมตร)|height=5feet 2inches→ 5 ฟุต 2 นิ้ว (157 เซนติเมตร)|height=5 feet 2 inches→ 5 ฟุต 2 นิ้ว (157 เซนติเมตร)|height=5 feet, 2 inches→ 5 ฟุต 2 นิ้ว (157 เซนติเมตร)|height=5 ft. 2 in.→ 5 ฟุต 2 นิ้ว (157 เซนติเมตร)
Text and/or footnotes (references) after height:
|height=5 feet 2 inches (2012)→ 5 ฟุต 2 นิ้ว (157 เซนติเมตร) (2012)|height=5 feet 2 inches<ref>citation goes here</ref>→ 5 ฟุต 2 นิ้ว (157 เซนติเมตร)[1]|height=5 feet 2 inches (2012)<ref>{{cite news|title=title|work=work}}</ref>→ 5 ฟุต 2 นิ้ว (157 เซนติเมตร) (2012)[2]
- ตัวอย่างการอ้างอิง
{{Convert}} templates, without and with wikilinked unit names:
|height={{Convert|5|ft|2|in|cm|abbr=off}}→ 5 ft 2 in (157 cm)|height={{Convert|5|ft|2|in|cm|abbr=off|lk=on}}→ 5 ft 2 in (157 cm)- output of convert template: 5 [[ฟุต]] 2 [[นิ้ว (หน่วยความยาวระบบอังกฤษ)|นิ้ว]] (157 [[เมตร|เซนติเมตร]])
|height={{Convert|5|ft|2|in|abbr=off}}→ 5 ft 2 in (1.57 m)|height={{Convert|5|ft|2|in|abbr=off|lk=on}}→ 5 ft 2 in (1.57 m)- output of convert template: 5 [[ฟุต]] 2 [[นิ้ว (หน่วยความยาวระบบอังกฤษ)|นิ้ว]] (1.57 [[เมตร]])
|height={{Convert|157|cm|ftin|abbr=off}}→ 157 cm (5 ft 2 in)|height={{Convert|157|cm|ftin|abbr=off|lk=on}}→ 157 cm (5 ft 2 in)- output of convert template: 157 [[เมตร|เซนติเมตร]] (5 [[ฟุต]] 2 [[นิ้ว (หน่วยความยาวระบบอังกฤษ)|นิ้ว]])
|height={{Convert|1.57|m|abbr=off}}→ 1.57 m (5 ft 2 in)|height={{Convert|1.57|m|abbr=off|lk=on}}→ 1.57 m (5 ft 2 in)- output of convert template: 1.57 [[เมตร]] (5 [[ฟุต]] 2 [[นิ้ว (หน่วยความยาวระบบอังกฤษ)|นิ้ว]])
ข้อยกเว้น
[แก้]Does not replace numbers in manually entered conversions, but does replace unit names with abbreviations (examples intentionally show incorrect conversions):
|height=5 feet 2 inches (1.00 metres)→ 5 ft 2 in (1.00 m)|height=5 feet 2 inches (100 centimetres)→ 5 ft 2 in (100 cm)|height=1.57 metres (5 feet 5 inches)→ 1.57 m (5 ft 5 in)|height=157 centimetres (5 feet 5 inches)→ 157 cm (5 ft 5 in)
Does not replace numeric output of conversion templates such as {{convert}} or {{height}}, but does replace unit names with abbreviations (examples intentionally show different precision than usual):
|height={{Convert|5|ft|2|in|m|3|abbr=off}}→ 5 ft 2 in (1.575 m)- output of convert template: 5 ฟุต 2 นิ้ว (1.575 เมตร)
|height={{Convert|5|ft|2|in|cm|sigfig=4|abbr=off}}→ 5 ft 2 in (157.5 cm)- output of convert template: 5 ฟุต 2 นิ้ว (157.5 เซนติเมตร)
|height={{Convert|1.57|m|ftin|1|abbr=off}}→ 1.57 m (5 ft 1.8 in)- output of convert template: 1.57 เมตร (5 ฟุต 1.8 นิ้ว)
|height={{Convert|157|cm|ftin|1|abbr=off}}→ 157 cm (5 ft 1.8 in)- output of convert template: 157 เซนติเมตร (5 ฟุต 1.8 นิ้ว)
|height={{Height|m=1.57|frac=4|abbr=no}}→ 1.57 m (5 ft 1 3⁄4 in)- output of height template: 1.57 เมตร (5 ฟุต 1 3⁄4 นิ้ว)
|height={{Height|cm=157|frac=4|abbr=no}}→ 157 cm (5 ft 1 3⁄4 in)- output of height template: 157 เซนติเมตร (5 ฟุต 1 3⁄4 นิ้ว)
Areas for improvement
[แก้]Conversion not displayed if unit name contains uppercase characters:
|height=157 Centimetres→ 157 Centim|height=157 CM→ 157 CM|height=1.57 Metres→ 1.57 Metres|height=1.57 M→ 1.57 M|height=5 Feet 2 Inches→ 5 Feet 2 Inches|height=5 FT 2 IN→ 5 FT 2 IN
Conversion not displayed if symbols are used for feet and inches:
|height=5' 2"→ 5' 2"|height=5′ 2″→ 5′ 2″
Does not recognize symbols for feet and inches in a manually entered conversion (adds a second conversion):
|height=157cm (5' 2")→ 157 เซนติเมตร (5 ฟุต 2 นิ้ว) (5' 2")|height=1.57m (5′ 2″)→ 1.57 เมตร (5 ฟุต 2 นิ้ว) (5′ 2″)