General Disclaimer: (HV) (DC) injury or death hazard, use at your own risk, may void warranty. |
Difference between revisions of "Template:Mpg"
Jump to navigation
Jump to search
(update to current version at Wikipedia.) |
(update from W:Template:Mpg) |
||
Line 1: | Line 1: | ||
− | <includeonly>{{{1}}} {{#switch:{{{lk|}}}|on=[[W:Miles per gallon|mpg]]|=mpg}} ({{#expr: ( 1 / {{{1}}} * 100 ) * 3.78541178 / 1.609344 round 2}} {{#switch:{{{lk|}}}|on=[[W:L/100 km|L/100 km]]|=L/100 km}})</includeonly><noinclude> | + | <includeonly>{{{1}}} {{#switch:{{{lk|}}}|on=[[W:Miles per gallon|mpg–U.S.]]|=mpg–U.S.}} ({{#expr: ( 1 / {{{1}}} * 100 ) * 3.78541178 / 1.609344 round 2}} {{#switch:{{{lk|}}}|on=[[W:L/100 km|L/100 km]]|=L/100 km}} / {{#expr:{{{1}}}* 1.20105680 round 1}} {{#switch:{{{lk|}}}|on=[[W:Imperial MPG|mpg–imp]]|=mpg–imp}})</includeonly><noinclude> |
− | Template to convert fuel mileage | + | |
− | :<nowiki> {{{1}}} mpg {{#expr: ( 1 / {{{1}}} * 100 ) * 3.78541178 / 1.609344 round 2}} L/100 km)</nowiki> | + | Template to convert fuel mileage from US mpg into Liters per 100 km and imperial mpg and display all three via: |
+ | :<nowiki> {{{1}}} mpg–U.S. {{#expr: ( 1 / {{{1}}} * 100 ) * 3.78541178 / 1.609344 round 2}} L/100 km / {{{1}}}* 1.20105680 round 1}} mpg–imp)</nowiki> | ||
Useage: | Useage: | ||
*<nowiki>{{mpg|45}}</nowiki> results in {{mpg|45}} | *<nowiki>{{mpg|45}}</nowiki> results in {{mpg|45}} | ||
Line 11: | Line 12: | ||
See also: | See also: | ||
+ | * [[Template:Mpg (Imperial)]] - For Imperial (UK) gallons version | ||
* [[Template:L100km]] | * [[Template:L100km]] | ||
* [[W:Template:Convert]] | * [[W:Template:Convert]] | ||
+ | |||
</noinclude> | </noinclude> |
Latest revision as of 11:33, 15 January 2008
Template to convert fuel mileage from US mpg into Liters per 100 km and imperial mpg and display all three via:
- {{{1}}} mpg–U.S. {{#expr: ( 1 / {{{1}}} * 100 ) * 3.78541178 / 1.609344 round 2}} L/100 km / {{{1}}}* 1.20105680 round 1}} mpg–imp)
Useage:
- {{mpg|45}} results in 45 mpg–U.S. (5.23 L/100 km / 54 mpg–imp)
- {{mpg|45|lk=on}} results in 45 mpg–U.S. (5.23 L/100 km / 54 mpg–imp)
Options:
- Make units wikilinked by attaching
|lk=on
.- The manual of style suggests that you only link the first instance.
See also:
- Template:Mpg (Imperial) - For Imperial (UK) gallons version
- Template:L100km
- W:Template:Convert