Skip to content

Commit

Permalink
use indexOf for backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Groves committed May 24, 2018
1 parent 8c046ae commit b62b1b1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bits/60_number.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function hashq(str/*:string*/)/*:string*/ {
}
function rnd(val/*:number*/, d/*:number*/)/*:string*/ {
var result
if(!("" + val).includes("e")) {
if(("" + val).indexOf("e") === -1) {
result = +(Math.round(val + "e+" + d) + "e-" + d);
} else {
var arr = ("" + val).split("e");
Expand Down
2 changes: 1 addition & 1 deletion ssf.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ function hashq(str/*:string*/)/*:string*/ {
}
function rnd(val/*:number*/, d/*:number*/)/*:string*/ {
var result
if(!("" + val).includes("e")) {
if(("" + val).indexOf("e") === -1) {
result = +(Math.round(val + "e+" + d) + "e-" + d);
} else {
var arr = ("" + val).split("e");
Expand Down
2 changes: 1 addition & 1 deletion ssf.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ function hashq(str) {
}
function rnd(val, d) {
var result
if(!("" + val).includes("e")) {
if(("" + val).indexOf("e") === -1) {
result = +(Math.round(val + "e+" + d) + "e-" + d);
} else {
var arr = ("" + val).split("e");
Expand Down

0 comments on commit b62b1b1

Please sign in to comment.