avoid inserting new operations after division by zero
This commit is contained in:
parent
e4e24bc226
commit
cf45c237bc
1 changed files with 4 additions and 1 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue