Difference between revisions of "Template:Val/delimitnum"
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|−}}<!-- Output the mathematical minus sign (not the minus-hyphen) if negative | -->{{#ifexpr:{{{1|0}}}<0|−}}<!-- 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 | ||
| − | + | -->{{formatnum:{{#expr:abs({{{1|0}}})}}}}<!-- Format the integer using locale's separator for grouping digits | |
| − | -->{{formatnum: | ||
-->|<!-- 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 | ||