Skip to content

Commit c47104e

Browse files
committed
Fix error from the previous commit
1 parent 09902db commit c47104e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/AdvDiv.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ String? advdiv(String n1, String n2, [final String minstr = "-", final String de
4747

4848
r1 = n1.contains(rstr1) ? (RegExp(RegExp.escape(rstr1)+r'(.+)'+RegExp.escape(rstr2)).firstMatch(n1.substring(n1.indexOf(".") + 1))?[1] ?? "0") : "0";
4949
if(r1!="0")
50-
n1 = n1.substring(0, n1.indexOf(".") + n1.substring(n1.indexOf(".") + 1).indexOf(rstr1));
50+
n1 = n1.substring(0, n1.indexOf(".") + n1.substring(n1.indexOf(".") + 1).indexOf(rstr1) + 1);
5151
n1 = n1.replaceFirst(RegExp(r'^0+'), "0").replaceFirst(RegExp(r1=="0" ? r'\.0*$' : r'\.$'), "");
5252
r2 = n2.contains(rstr1) ? (RegExp(RegExp.escape(rstr1)+r'(.+)'+RegExp.escape(rstr2)).firstMatch(n2.substring(n2.indexOf(".") + 1))?[1] ?? "0") : "0";
5353
if(r2!="0")
54-
n2 = n2.substring(0, n2.indexOf(".") + n2.substring(n2.indexOf(".") + 1).indexOf(rstr1));
54+
n2 = n2.substring(0, n2.indexOf(".") + n2.substring(n2.indexOf(".") + 1).indexOf(rstr1) + 1);
5555
n2 = n2.replaceFirst(RegExp(r'^0+'), "0").replaceFirst(RegExp(r2=="0" ? r'\.0*$' : r'\.$'), "");
5656

5757

0 commit comments

Comments
 (0)