1
0
Bernadette Elena Hammerle 2 жил өмнө
parent
commit
dfcfb45084
1 өөрчлөгдсөн 3 нэмэгдсэн , 0 устгасан
  1. 3 0
      src/Subtraction.js

+ 3 - 0
src/Subtraction.js

@@ -361,6 +361,9 @@ function Subtraction() {
         text += " + " + carries[idxCarry]; // + " Übertrag"
       }
       let realCarry = Math.abs(parseInt(realDigitRes/10));
+      if(firstDigit !== 0 && realDigitRes % 10 === 0){
+        realCarry -= 1;
+      }
       realDigitRes = ((firstDigit - realDigitRes) % 10);
 
       if(realDigitRes < 0){