Skip to content

Commit

Permalink
Fix precision count
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanchuan committed Sep 4, 2023
1 parent a552e57 commit c489e83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ function get_grid(input) {
}

function round(value, precision = 6) {
const power = Math.pow(10, precision)
const power = Math.pow(10, precision + 1)
let result = Math.round((value * power) + (Number.EPSILON * power)) / power;
if (Number.isNaN(result)) result = 0;
return result;
Expand Down

0 comments on commit c489e83

Please sign in to comment.