Module talk:Formatnum: Difference between revisions

Content deleted Content added
Zero precision not working?
#invoke: new section
Line 11:
 
If I use <code>fn.formatNum(5435.12345,"en",2)</code> I get the result <code>5,435.12</code> as expected. Similarly with other positive values for precision. But with <code>fn.formatNum(5435.12345,"en",0)</code> the number is returned with all the post decimal point digits, i.e. <code>5,435.12345</code>). Looking at the code there are a couple of <code>if prec > 0 then ... elseif prec < 0 then .. end</code> blocks which suggests zero is ignored. Is this intentional or an oversight? <span style="font-family:Arial;background:#d6ffe6;border:solid 1px;border-radius:5px;box-shadow:darkcyan 0px 1px 1px;">&nbsp;&nbsp;[[User:Jts1882|Jts1882]]&nbsp;&#124;[[User talk:Jts1882|&nbsp;talk]]&nbsp;</span> 15:35, 9 December 2019 (UTC)
 
== #invoke ==
 
The production code cannot be #invoke'd normally, only wrapped by templates. The sandbox code fixes this. [[User:Trigenibinion|Trigenibinion]] ([[User talk:Trigenibinion|talk]]) 11:56, 3 March 2021 (UTC)