Jump to content

Template:Dist: Difference between revisions

oops, can't insert a newline there unless it's commented out
(mentioned "po" and special ft+in conversion in docs)
(oops, can't insert a newline there unless it's commented out)
 
Line 10: Line 10:
| {{#expr:{{#ifeq:{{{2|}}}|in|1|0}} and {{#ifeq:{{{3|}}}|ft|1|0}} }} = {{#ifeq:{{{po|}}}|yes||{{{1|}}} in (}}{{#expr:trunc ({{{1|}}} / 12.000) }} ft {{#expr:{{{1|}}} mod 12}} in{{#ifeq:{{{po|}}}|yes||)}}
| {{#expr:{{#ifeq:{{{2|}}}|in|1|0}} and {{#ifeq:{{{3|}}}|ft|1|0}} }} = {{#ifeq:{{{po|}}}|yes||{{{1|}}} in (}}{{#expr:trunc ({{{1|}}} / 12.000) }} ft {{#expr:{{{1|}}} mod 12}} in{{#ifeq:{{{po|}}}|yes||)}}
| #default = '''<span style="color:red">(error from Template:Dist: unsupported conversion)</span>'''
| #default = '''<span style="color:red">(error from Template:Dist: unsupported conversion)</span>'''
}}</includeonly>
}}</includeonly><noinclude><!--
<noinclude>Call this template to convert between metric and imperial units of length. Both the original and converted length will be displayed, with the unit you supplied coming first, or only the converted length if you use the "po" parameter (see {{SectionLink||Display}}). The template can also convert a figure in inches to feet and inches.
-->Call this template to convert between metric and imperial units of length. Both the original and converted length will be displayed, with the unit you supplied coming first, or only the converted length if you use the "po" parameter (see {{SectionLink||Display}}). The template can also convert a figure in inches to feet and inches.


See [[Template:Temp]] for a temperature conversion template.
See [[Template:Temp]] for a temperature conversion template.


==Supported conversions==
==Supported conversions==
Here are all the conversions supported by the template. If you want anything else to be supported, it's fairly easy to add new conversions: copy a line and change the unit names and the constant for converting between them.
Here are all the conversions supported by the template. If you want anything else to be supported, it's fairly easy to add new conversions: copy a line of code and simply change the unit names and the constant for converting between them.


===cm <-> in===
===cm <-> in===