Difference between revisions of "Template:Val/delimitnum"

From blackwiki
Jump to navigation Jump to search
blackwiki>SkyLined
(add #expr:abs() to last change to remove hyphen (a minus is already output))
blackwiki>SkyLined
(Reverted to revision 431613366 by Jason Quinn: Bad changes caused errors in negative numbers. (TW))
Line 5: Line 5:
 
   -->{{#ifexpr:{{{1|0}}}<0|&minus;}}<!-- Output the mathematical minus sign (not the minus-hyphen) if negative
 
   -->{{#ifexpr:{{{1|0}}}<0|&minus;}}<!-- Output the mathematical minus sign (not the minus-hyphen) if negative
 
   -->{{#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
+
     -->{{formatnum:{{#expr:abs({{{1|0}}})}}}}<!-- Format the integer using locale's separator for grouping digits
     -->{{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 23:16, 13 December 2012

50px Template documentation[create]