locbet / jquery-numberformatter

Automatically exported from code.google.com/p/jquery-numberformatter
0 stars 0 forks source link

Zero number formats with ,00 #65

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. $.formatNumber(0, {format:"#,####.00"});

What is the expected output? 
0.00

What do you see instead?
.00

What version of the product are you using? On what operating system?
1.2.3

Original issue reported on code.google.com by gers...@gmail.com on 29 Jun 2012 at 4:57

GoogleCodeExporter commented 8 years ago
I changed code on line 368  like this to solve this issue. It was 
onesFormat.indexOf('0' .... change to '#'. 

if (!onePortion && onesFormat.indexOf('#', onesFormat.length - 1) !== -1)
    onePortion = '0';

Not sure if it the correct solution. 

- anonyme

Original comment by anonyme....@gmail.com on 9 Mar 2013 at 2:29

GoogleCodeExporter commented 8 years ago
I think this is not valid, the expected output is not correct, you should 
specify something like #,###0.00 if you wanted at least a zero before the 
decimal point.

Original comment by apar...@gmail.com on 18 Oct 2013 at 12:51