Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rounding bug #79

Merged
merged 1 commit into from
May 9, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.