Fixed changing operator after dividing by zero (#202)

This commit is contained in:
Agnieszka C
2021-12-05 10:39:04 +01:00
parent 09263a5f9a
commit f92d80099b

View File

@ -118,8 +118,14 @@ class CalculatorImpl(calculator: Calculator, private val context: Context) {
} }
} }
lastKey = operation if (getSecondValue() == 0.0 && inputDisplayedFormula.contains("÷")) {
lastOperation = operation lastKey = DIVIDE
lastOperation = DIVIDE
} else {
lastKey = operation
lastOperation = operation
}
showNewResult(inputDisplayedFormula) showNewResult(inputDisplayedFormula)
} }