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 09902db commit c47104e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/AdvDiv.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ String? advdiv(String n1, String n2, [final String minstr = "-", final String de

r1 = n1.contains(rstr1) ? (RegExp(RegExp.escape(rstr1)+r'(.+)'+RegExp.escape(rstr2)).firstMatch(n1.substring(n1.indexOf(".") + 1))?[1] ?? "0") : "0";
if(r1!="0")
n1 = n1.substring(0, n1.indexOf(".") + n1.substring(n1.indexOf(".") + 1).indexOf(rstr1));
n1 = n1.substring(0, n1.indexOf(".") + n1.substring(n1.indexOf(".") + 1).indexOf(rstr1) + 1);
n1 = n1.replaceFirst(RegExp(r'^0+'), "0").replaceFirst(RegExp(r1=="0" ? r'\.0*$' : r'\.$'), "");
r2 = n2.contains(rstr1) ? (RegExp(RegExp.escape(rstr1)+r'(.+)'+RegExp.escape(rstr2)).firstMatch(n2.substring(n2.indexOf(".") + 1))?[1] ?? "0") : "0";
if(r2!="0")
n2 = n2.substring(0, n2.indexOf(".") + n2.substring(n2.indexOf(".") + 1).indexOf(rstr1));
n2 = n2.substring(0, n2.indexOf(".") + n2.substring(n2.indexOf(".") + 1).indexOf(rstr1) + 1);
n2 = n2.replaceFirst(RegExp(r'^0+'), "0").replaceFirst(RegExp(r2=="0" ? r'\.0*$' : r'\.$'), "");


Expand Down

0 comments on commit c47104e

Please sign in to comment.