locutusjs / locutus

Bringing stdlibs of other programming languages to JavaScript for educational purposes

Home Page:https://locutus.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fmod(): toFixed() digits argument must be between 0 and 100

dekairi opened this issue · comments

commented

fmod(10, 1) causes the error:
Uncaught RangeError: toFixed() digits argument must be between 0 and 100
Possible solution:

else {
     return parseFloat(tmp2.toFixed(Math.abs(p))); // instead of (toFixed(-p))
}