Difference between revisions of "Template:Val/delimitnum"

From blackwiki
Jump to navigation Jump to search
blackwiki>Cpiral
(swap in the 4-digit-integer handling logic)
blackwiki>SkyLined
(add #expr:abs() to last change to remove hyphen (a minus is already output))
Line 6: Line 6:
 
   -->{{#ifexpr:abs({{{1|0}}}1)>10*abs({{{1|0}}})|<!-- Number is an integer (no dot): appending a non-zero digit multiplies it by more than 10
 
   -->{{#ifexpr:abs({{{1|0}}}1)>10*abs({{{1|0}}})|<!-- Number is an integer (no dot): appending a non-zero digit multiplies it by more than 10
 
   -->{{#ifexpr:{{{1|0}}}>9999|<!-- If the integer is more than four digits
 
   -->{{#ifexpr:{{{1|0}}}>9999|<!-- If the integer is more than four digits
     -->{{formatnum:{{#expr:abs({{{1|0}}})}}}}|{{{1|0}}}}}<!-- Group digits using locale separator; else output the four digit number
+
     -->{{formatnum:{{#expr:abs({{{1|0}}})}}}}|{{#expr:abs({{{1|0}}})}}}}<!-- Group digits using locale separator; else output the four digit number
 
   -->|<!-- Number is not an integer (at least contains a dot)
 
   -->|<!-- Number is not an integer (at least contains a dot)
 
     -->{{formatnum:{{#expr:trunc(abs({{{1|0}}}))}}.}}<!-- Format the integer part using locale's separator for grouping digits, followed by the locale's separator before fractional decimals
 
     -->{{formatnum:{{#expr:trunc(abs({{{1|0}}}))}}.}}<!-- Format the integer part using locale's separator for grouping digits, followed by the locale's separator before fractional decimals

Revision as of 22:50, 13 December 2012

50px Template documentation[create]