Skip to content

Commit

Permalink
Fix error from the previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ratajs committed Aug 25, 2023
1 parent e3baa7c commit de95f6e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions AdvDiv.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ function advdiv(n1, n2, minstr, decstr, rstr1, rstr2) {

r1 = (n1.indexOf(rstr1) > -1) ? (new RegExp(RegExp.escape(rstr1)+"(.+)"+RegExp.escape(rstr2)).exec(n1.slice(n1.indexOf(".") + 1)) || ["0", "0"])[1] : "0";
if(r1!="0")
n1 = n1.slice(0, n1.indexOf(".") + n1.slice(n1.indexOf(".") + 1).indexOf(rstr1));
n1 = n1.slice(0, n1.indexOf(".") + n1.slice(n1.indexOf(".") + 1).indexOf(rstr1) + 1);
n1 = n1.replace(/^0+/, "0").replace(r1=="0" ? /\.0*$/ : /\.*$/, "");
r2 = (n2.indexOf(rstr1) > -1) ? (new RegExp(RegExp.escape(rstr1)+"(.+)"+RegExp.escape(rstr2)).exec(n2.slice(n2.indexOf(".") + 1)) || ["0", "0"])[1] : "0";
if(r2!="0")
n2 = n2.slice(0, n2.indexOf(".") + n2.slice(n2.indexOf(".") + 1).indexOf(rstr1));
n2 = n2.slice(0, n2.indexOf(".") + n2.slice(n2.indexOf(".") + 1).indexOf(rstr1) + 1);
n2 = n2.replace(/^0+/, "0").replace(r2=="0" ? /\.0*$/ : /\.*$/, "");


Expand Down
2 changes: 1 addition & 1 deletion AdvDiv.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit de95f6e

Please sign in to comment.