Difference between revisions of "Template:Height"

From MidsouthMakers - Memphis Area Hackerpace
Jump to navigation Jump to search
m (1 revision)
 
m (1 revision)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
<includeonly>{{#ifexpr:({{#if:{{{meter|{{{meters|{{{metre|{{{metres|{{{m|}}}}}}}}}}}}}}}|1|0}} AND ({{#if:{{{foot|{{{feet|{{{ft|}}}}}}}}}|1|0}} OR {{#if:{{{inch|{{{inches|{{{in|}}}}}}}}}|1|0}}))|<font color="red">Error: please specify only imperial or only metric units</font>|{{{{#if:{{{meter|{{{meters|{{{metre|{{{metres|{{{m|}}}}}}}}}}}}}}}|m to ft in|ft in to m}}|frac={{{frac|2}}}|abbr={{{abbr|yes}}}|wiki={{{wiki|no}}}|precision={{#if:{{{meter|{{{meters|{{{metre|{{{metres|{{{m|}}}}}}}}}}}}}}}|{{{precision|1}}}|{{{precision|2}}}}}|{{#if:{{{meter|{{{meters|{{{metre|{{{metres|{{{m|}}}}}}}}}}}}}}}|{{{meter|{{{meters|{{{metre|{{{metres|{{{m}}}}}}}}}}}}}}}}}{{#if:{{{foot|{{{feet|{{{ft|}}}}}}}}}|{{{foot|{{{feet|{{{ft}}}}}}}}}}}{{#ifexpr:({{#if:{{{inch|{{{inches|{{{in|}}}}}}}}}|1|0}} AND {{#if:{{{foot|{{{feet|{{{ft|}}}}}}}}}|0|1}})|0}}|{{#if:{{{foot|{{{feet|{{{ft|}}}}}}}}}|{{{inch|{{{inches|{{{in|0}}}}}}}}}}}{{#ifexpr:{{#if:{{{foot|{{{feet|{{{ft|}}}}}}}}}|0|1}} AND {{#if:{{{meter|{{{meters|{{{metre|{{{metres|{{{m|}}}}}}}}}}}}}}}|0|1}}|{{{inch|{{{inches|{{{in|0}}}}}}}}}}}}}}}</includeonly><noinclude>
 
<includeonly>{{#ifexpr:({{#if:{{{meter|{{{meters|{{{metre|{{{metres|{{{m|}}}}}}}}}}}}}}}|1|0}} AND ({{#if:{{{foot|{{{feet|{{{ft|}}}}}}}}}|1|0}} OR {{#if:{{{inch|{{{inches|{{{in|}}}}}}}}}|1|0}}))|<font color="red">Error: please specify only imperial or only metric units</font>|{{{{#if:{{{meter|{{{meters|{{{metre|{{{metres|{{{m|}}}}}}}}}}}}}}}|m to ft in|ft in to m}}|frac={{{frac|2}}}|abbr={{{abbr|yes}}}|wiki={{{wiki|no}}}|precision={{#if:{{{meter|{{{meters|{{{metre|{{{metres|{{{m|}}}}}}}}}}}}}}}|{{{precision|1}}}|{{{precision|2}}}}}|{{#if:{{{meter|{{{meters|{{{metre|{{{metres|{{{m|}}}}}}}}}}}}}}}|{{{meter|{{{meters|{{{metre|{{{metres|{{{m}}}}}}}}}}}}}}}}}{{#if:{{{foot|{{{feet|{{{ft|}}}}}}}}}|{{{foot|{{{feet|{{{ft}}}}}}}}}}}{{#ifexpr:({{#if:{{{inch|{{{inches|{{{in|}}}}}}}}}|1|0}} AND {{#if:{{{foot|{{{feet|{{{ft|}}}}}}}}}|0|1}})|0}}|{{#if:{{{foot|{{{feet|{{{ft|}}}}}}}}}|{{{inch|{{{inches|{{{in|0}}}}}}}}}}}{{#ifexpr:{{#if:{{{foot|{{{feet|{{{ft|}}}}}}}}}|0|1}} AND {{#if:{{{meter|{{{meters|{{{metre|{{{metres|{{{m|}}}}}}}}}}}}}}}|0|1}}|{{{inch|{{{inches|{{{in|0}}}}}}}}}}}}}}}</includeonly><noinclude>
  
{{pp-template|small=yes}}
 
 
{{Documentation}}
 
{{Documentation}}
 
<!-- Add categories and interwikis to the /doc subpage, not here! -->
 
<!-- Add categories and interwikis to the /doc subpage, not here! -->
 
</noinclude>
 
</noinclude>

Latest revision as of 13:48, 1 September 2010


[edit] [purge] Template documentation

Instructions

  • The template is intended for conversion of heights specified in either meters, or in feet and inches. Meters are converted to feet and inches, and feet and inches are converted to meters.
  • As this template is intended for use in infoboxes, the units on both sides of the conversion are abbreviated by default. When using this template outside of infoboxes, use the abbr parameter, which can take values of yes (default; both sides of the conversion are abbreviated), no (both sides of the conversion are spelled out), or mos (WP:MOSNUM-compliant format, where the units being converted are spelled out and the units of the converted values are abbreviated).
  • For conversion of meters to feet/inches, the frac parameter can be specified to either show the output inches as decimals (frac=10) or as a vulgar fraction (frac=desired denominator; the default is 2 for halves). The frac parameter is ignored for conversion of feet/inches to meters.
  • When decimal output is used, the default precision is 1 for meters-to-feet/inches conversion and 2 for feet/inches-to-meters conversion, but it can be overridden by specifying a different figure using the precision parameter (see example below). The precision parameter is ignored when frac is set to anything but 10.
  • wiki parameter specifies whether the names of the units should be wikified or not and can take values of either yes or no. The default value is no.

Code

Code Result
{{height|m=1.72}} 1.72 m (5 ft 7 12 in)
{{height|m=1.72|precision=0}} 1.72 m (5 ft 8 in)
{{height|m=1.72|frac=16}} 1.72 m (5 ft 7 1116 in)
{{height|ft=6}} 6 ft 0 in (1.83 m)
{{height|ft=6|in=1}} 6 ft 1 in (1.85 m)
{{height|ft=6|in=1|precision=1}} 6 ft 1 in (1.9 m)
{{height|in=10}} 0 ft 10 in (0.25 m)
{{height|m=1.72|abbr=no}} 1.72 meters (5 feet 7 12 inches)
{{height|ft=6|in=2|abbr=mos}} 6 feet 2 inches (1.88 m)
{{height|ft=6|in=2|wiki=yes}} ft 2 in (1.88 m)
{{height|m=6|ft=2}} Error: please specify only imperial or only metric units
  • m is for meters
  • ft is for feet
  • in is for inches

See also

ca:Plantilla:Height es:Plantilla:Altura ja:Template:Height no:Mal:Høyde zh:Template:Height