Difference between revisions of "Template:Infobox UK place/dist"

From blackwiki
Jump to navigation Jump to search
imported>Lightmouse
(Mostly units)
imported>Johnuniq
(use Module:Convert/helper to remove any reference from number to avoid expression errors (convert handles a reference included in the input value); this is for Cairndow and more)
 
(One intermediate revision by one other user not shown)
Line 4: Line 4:
 
rounding of output is based on input, unless less than 10 when one decimal place is used
 
rounding of output is based on input, unless less than 10 when one decimal place is used
  
--><includeonly>{{#ifeq: {{{type|}}}|mile|<!-- then -->{{convert|{{formatnum: {{{distance|}}}|R}}|mi|km|abbr=on|{{#ifexpr: {{formatnum: {{{distance|}}}|R}}<10|1|}} }}|<!-- else -->{{convert|{{formatnum: {{{distance|}}}|R}}|km|mi|abbr=on|{{#ifexpr: {{formatnum: {{{distance|}}}|R}}<10|1|}} }} }}</includeonly>
+
--><includeonly>{{#ifeq: {{{type|}}}|mile|<!-- then -->{{convert|{{{distance|}}}|mi|km|abbr=on|{{#ifexpr: {{#invoke:convert/helper|cleanNumber|{{{distance|1}}}}}<10|1|}} }}|<!-- else -->{{convert|{{{distance|}}}|km|mi|abbr=on|{{#ifexpr: {{#invoke:convert/helper|cleanNumber|{{{distance|1}}}}}<10|1|}} }} }}</includeonly>

Latest revision as of 10:04, 19 June 2018