Skip to content

Commit

Permalink
getPrecision use Math.round instead of | 0 to avoid precision problem
Browse files Browse the repository at this point in the history
  • Loading branch information
pissang committed Jul 1, 2015
1 parent fa23d44 commit 3e2a3d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/number.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ define(function() {
function getPrecision(val) {
var e = 1;
var count = 0;
while (((val * e) | 0) / e !== val) {
while (Math.round(val * e) / e !== val) {
e *= 10;
count++;
}
Expand Down

0 comments on commit 3e2a3d6

Please sign in to comment.