Skip to content

Commit

Permalink
Merge pull request #79 from indrimuska/master
Browse files Browse the repository at this point in the history
Fix rounding bug
  • Loading branch information
samatcd committed May 9, 2015
2 parents e1630bc + a952fe9 commit afcf049
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions jquery.number.js
Original file line number Diff line number Diff line change
Expand Up @@ -746,8 +746,7 @@
var n = !isFinite(+number) ? 0 : +number,
s = '',
toFixedFix = function (n, decimals) {
var k = Math.pow(10, decimals);
return '' + Math.round(n * k) / k;
return '' + (+(Math.round(n + 'e+' + decimals) + 'e-' + decimals));
};

// Fix for IE parseFloat(0.55).toFixed(0) = 0;
Expand Down
2 changes: 1 addition & 1 deletion jquery.number.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit afcf049

Please sign in to comment.