Difference between revisions of "Template:Infobox road/meta/length/sandbox"
Jump to navigation
Jump to search
imported>WOSlinker (add 1 to length when passing to Getprecision to work around bug in Getprecision) |
imported>BrownHairedGirl (remove non-existent Category:Infobox road) |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| − | + | {{#ifexpr:{{{length|567.3}}}>=1000|{{formatnum:{{{length|567.3}}}}}|{{{length|567.3}}}}} {{{1|mi}}}{{#if:{{{length_ref|}}}|{{{length_ref}}}|}} (<!-- | |
| + | -->{{#expr:{{{length|567.3}}} * {{#ifeq:{{{1|mi}}}|mi|1.609344|0.621371192}} round {{#if:{{{round|}}}|{{{round}}}|{{precision|{{{length|567.3}}}|}} }} }} {{#ifeq:{{{1|mi}}}|mi|km|mi}})<noinclude> | ||
| + | |||
| + | The '''[[Template:Infobox_road/meta/length]]''' converts miles to [[kilometre]]s, or the reverse, where parameter 1 is "mi" or "km" and the distance is length=567.3 or such. | ||
| + | |||
| + | The template rounds the result to the precision of the input decimal digits, where, for example, {{precision|234.65}} is {{precision|234.65}}, for 2 decimal digits. The template expansion depth is 6 levels, of the 41-level limit. | ||
| + | </noinclude> | ||
Latest revision as of 01:42, 5 March 2017
567.3 mi (Expression error: Unrecognized punctuation character "[". km)
The Template:Infobox_road/meta/length converts miles to kilometres, or the reverse, where parameter 1 is "mi" or "km" and the distance is length=567.3 or such.
The template rounds the result to the precision of the input decimal digits, where, for example, {{precision|234.65}} is Template:Precision, for 2 decimal digits. The template expansion depth is 6 levels, of the 41-level limit.