Skip to content

Commit

Permalink
fix incorrect replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Feb 18, 2021
1 parent 66770c8 commit 3ec7426
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/core-js/modules/es.number.to-fixed.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,25 +91,25 @@ $({ target: 'Number', proto: true, forced: FORCED }, {
z *= 0x10000000000000;
e = 52 - e;
if (e > 0) {
multiply(divide, 0, z);
multiply(data, 0, z);
j = fractDigits;
while (j >= 7) {
multiply(divide, 1e7, 0);
multiply(data, 1e7, 0);
j -= 7;
}
multiply(divide, pow(10, j, 1), 0);
multiply(data, pow(10, j, 1), 0);
j = e - 1;
while (j >= 23) {
divide(data, 1 << 23);
j -= 23;
}
divide(data, 1 << j);
multiply(divide, 1, 1);
multiply(data, 1, 1);
divide(data, 2);
result = dataToString(data);
} else {
multiply(divide, 0, z);
multiply(divide, 1 << -e, 0);
multiply(data, 0, z);
multiply(data, 1 << -e, 0);
result = dataToString(data) + repeat.call('0', fractDigits);
}
}
Expand Down

0 comments on commit 3ec7426

Please sign in to comment.