19,577
edits
(Created page with "<includeonly>{{#ifeq:{{{2|}}}| C|{{{1}}}° C ({{#expr:({{{1|}}} * 1.8) + {{#ifeq:{{{4|0}}}|0|32|0}} round {{#expr:{{{3|0}}} + 1}} }}° F)|...") |
(not sure why I thought this adjustment to round() was needed) |
||
Line 1: | Line 1: | ||
<includeonly>{{#ifeq:{{{2|}}}| | <includeonly>{{#ifeq:{{{2|}}}| | ||
C|{{{1}}}° C ({{#expr:({{{1|}}} * 1.8) + {{#ifeq:{{{4|0}}}|0|32|0}} round | C|{{{1}}}° C ({{#expr:({{{1|}}} * 1.8) + {{#ifeq:{{{4|0}}}|0|32|0}} round {{{3|0}}} }}° F)| | ||
{{#ifeq:{{{2|}}}| | {{#ifeq:{{{2|}}}| | ||
F|{{{1}}}° F ({{#expr:({{{1|}}} - {{#ifeq:{{{4|0}}}|0|32|0}}) / 1.8 round | F|{{{1}}}° F ({{#expr:({{{1|}}} - {{#ifeq:{{{4|0}}}|0|32|0}}) / 1.8 round {{{3|0}}} }}° C)| | ||
'''<span style="color:red">(error from Template:Temp: the unit was not given as 'C' or 'F') | '''<span style="color:red">(error from Template:Temp: the unit was not given as 'C' or 'F')</span>'''}} }}</includeonly><noinclude>Call this template to convert a temperature between Celsius and Fahrenheit. Both will be displayed, with the unit you supplied coming first. | ||
==Simplest use case== | ==Simplest use case== | ||
Line 30: | Line 30: | ||
<tt><nowiki>{{Temp|9|C|0|r}}</nowiki></tt><br> | <tt><nowiki>{{Temp|9|C|0|r}}</nowiki></tt><br> | ||
yields<br> | yields<br> | ||
{{Temp|9| | {{Temp|9|C|0|r}} | ||
[[Category:Utility templates]]</noinclude> | [[Category:Utility templates]]</noinclude> |