Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 671b578

Browse files
committed
rewrite logic using e+ check
1 parent ebb63c8 commit 671b578

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/lib/increment.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,7 @@ module.exports = function incrementNumeric(x, delta) {
3232

3333
if(lenX1 >= lenX0 + lenDt) { // likely a rounding error!
3434
var s = parseFloat(newX).toPrecision(12);
35-
if(
36-
s.indexOf('e') === -1 ||
37-
s.indexOf('e-') !== -1
38-
) {
39-
newX = +s;
40-
}
35+
if(s.indexOf('e+') === -1) newX = +s;
4136
}
4237
}
4338

0 commit comments

Comments
 (0)