locbet / jquery-numberformatter

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

Number.toFixed #38

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. in IE Number.toFixed(x) does no rounding
2. in Firefox/Webkit Number.toFixed(x) does rounding

What is the expected output? What do you see instead?
An input of 0.05 with a format of #,##0.0 should result in 0.1:

IE = 0.0
Firefox/Webkit = 0.1

Please provide any additional information below.

Remove toFixed on #283 and either round or truncate, e.g to round:

var k = Math.pow(10, decimalFormat.length);
number = (Math.round(number * k) / k).toString();

Original issue reported on code.google.com by garg...@gmail.com on 15 Feb 2011 at 1:37

GoogleCodeExporter commented 8 years ago
Thanks for the fix. Not a big surprise MS had messed this up, it seems ok in 
IE9 but will confirm and retest with IE6.

Original comment by apar...@gmail.com on 13 Apr 2011 at 4:02

GoogleCodeExporter commented 8 years ago
Tested in ie6 and confirmed as issue.

Fixed and code checked into svn repo.

Original comment by apar...@gmail.com on 25 Apr 2011 at 12:58