https://heald.nga.gov/mediawiki/index.php?title=Template:Val/delimitnum&feed=atom&action=historyTemplate:Val/delimitnum - Revision history2024-03-28T10:59:34ZRevision history for this page on the wikiMediaWiki 1.35.2https://heald.nga.gov/mediawiki/index.php?title=Template:Val/delimitnum&diff=2677&oldid=prevEmily Pugh: 1 revision2013-09-10T20:36:00Z<p>1 revision</p>
<p><b>New page</b></p><div><includeonly><!--<br />
-->{{#ifexpr:({{{1|0}}}1)=({{{1|0}}})|<!-- Test loss of precision by appending a fixed digit "1"<br />
-->{{FormattingError|Too Many Digits|nocategory={{{nocategory|}}}}}<!--<br />
-->|<!-- No loss of precision, can display this number<br />
-->{{#ifexpr:{{{1|0}}}<0|&minus;}}<!-- Output the mathematical minus sign (not the minus-hyphen) if negative<br />
-->{{#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<br />
-->{{formatnum:{{#expr:abs({{{1|0}}})}}}}<!-- Format the integer using locale's separator for grouping digits<br />
-->|<!-- Number is not an integer (at least contains a dot)<br />
-->{{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<br />
-->{{val/delimitnum/fraction<!--<br />
-->|{{#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)<br />
-->|{{#expr:(-ln(abs({{{1|0}}}1)-abs({{{1|0}}}))/ln10round 0)-1}}<!-- The number of decimals to display (the difference of absolute values is the value of the appended digit 1, its log10 gives its position)<br />
-->|nocategory={{{nocategory|}}}<!-- category if formatting error (too many digits)<br />
-->}}<!--<br />
-->}}<!--<br />
-->}}</includeonly><noinclude>{{documentation}}</noinclude></div>Emily Pugh