avoid inserting new operations after division by zero

This commit is contained in:
tibbi 2020-12-28 20:57:05 +01:00
parent e4e24bc226
commit cf45c237bc

View file

@ -98,8 +98,11 @@ class CalculatorImpl(calculator: Calculator, private val context: Context) {
} else {
secondValue = getSecondValue()
calculateResult()
if (!operations.contains(inputDisplayedFormula.last().toString())) {
inputDisplayedFormula += getSign(operation)
if (!inputDisplayedFormula.contains("/")) {
inputDisplayedFormula += getSign(operation)
}
}
}
}