Template:Val/delimitnum: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Peter James
https://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_%28technical%29&oldid=537611659#Insidious_problem_with_pdf_rendering
meta>Jimp
delimiting using gaps either side of the decimal point per MOSNUM, see Template_talk:Val#Delimiting
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
     -->{{formatnum:{{#expr:abs({{{1|0}}})}}}}<!-- Format the integer using locale's separator for grouping digits
     -->{{val/delimitnum/whole|{{#expr:abs({{{1|0}}})}}}}<!-- Format the integer part using (a) thin space(s) for grouping digits
   -->|<!-- 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
     -->{{val/delimitnum/whole|{{#expr:trunc(abs({{{1|0}}}))}}}}.<!-- Format the integer part using (a) thin space(s) for grouping digits, followed by the locale's separator before fractional decimals (a decimal point on en-WP)
     -->{{val/delimitnum/fraction<!--
     -->{{val/delimitnum/fraction<!--
       -->|{{#expr:abs({{{1|0}}}1)-trunc(abs({{{1|0}}}1))}}<!-- The fractional part (appended with an extra digit 1 to avoid roundoff error on last displayed digit)
       -->|{{#expr:abs({{{1|0}}}1)-trunc(abs({{{1|0}}}1))}}<!-- The fractional part (appended with an extra digit 1 to avoid roundoff error on last displayed digit)

Revision as of 09:31, 15 January 2014