Difference between revisions of "Template:Convert"

From LFS Manual
Jump to navigationJump to search
m
m
Line 1: Line 1:
<includeonly>{{#expr:  
+
<includeonly>{{{1}}} {{#ifeq:{{{2|}}}
 +
| km | km
 +
| kmh | km/h
 +
}} ({{#expr:  
 
{{{1}}} *  
 
{{{1}}} *  
 
{{#ifeq:{{{2|}}}-{{{3|}}} | km-mi | 0.621371192 }}
 
{{#ifeq:{{{2|}}}-{{{3|}}} | km-mi | 0.621371192 }}
 
{{#ifeq:{{{2|}}}-{{{3|}}} | kmh-mph | 0.621371192 }}
 
{{#ifeq:{{{2|}}}-{{{3|}}} | kmh-mph | 0.621371192 }}
round 3
+
round {{{4|3}}}
}}</includeonly><noinclude>{{documentation}}</noinclude>
+
}} {{#ifeq:{{{3|}}}
 +
| mi | mi
 +
| mph | mph
 +
}})</includeonly><noinclude>{{documentation}}</noinclude>

Revision as of 15:03, 9 December 2023

Template Info-Icon.png

Template documentation

View - Edit

Usage

Markup Renders as
{{convert|1|km|mi|round=2}}

1 km (0.621 mi)

Markup Renders as
{{convert|1|km2|mi2|round=2}}

1 kmh (Expression error: Unexpected round operator. mph)

Markup Renders as
{{convert|1|kmh|mph|round=3}}

1 kmh (0.621 mph)

Markup Renders as
{{convert|1|kmh|mph|round=2}}

1 kmh (0.621 mph)

Markup Renders as
{{convert|200|kw|bhp}}

200 kmh (Expression error: Unexpected round operator. mph)

Markup Renders as
{{convert|400|nm|lbft}}

400 kmh (Expression error: Unexpected round operator. mph)