Skip to content

Commit 3e2a3d6

Browse files
committed
getPrecision use Math.round instead of | 0 to avoid precision problem
1 parent fa23d44 commit 3e2a3d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util/number.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ define(function() {
7474
function getPrecision(val) {
7575
var e = 1;
7676
var count = 0;
77-
while (((val * e) | 0) / e !== val) {
77+
while (Math.round(val * e) / e !== val) {
7878
e *= 10;
7979
count++;
8080
}

0 commit comments

Comments
 (0)