mirror of
https://github.com/SimpleMobileTools/Simple-Calculator.git
synced 2025-06-05 21:49:13 +02:00
avoid inserting new operations after division by zero
This commit is contained in:
@@ -98,8 +98,11 @@ class CalculatorImpl(calculator: Calculator, private val context: Context) {
|
|||||||
} else {
|
} else {
|
||||||
secondValue = getSecondValue()
|
secondValue = getSecondValue()
|
||||||
calculateResult()
|
calculateResult()
|
||||||
|
|
||||||
if (!operations.contains(inputDisplayedFormula.last().toString())) {
|
if (!operations.contains(inputDisplayedFormula.last().toString())) {
|
||||||
inputDisplayedFormula += getSign(operation)
|
if (!inputDisplayedFormula.contains("/")) {
|
||||||
|
inputDisplayedFormula += getSign(operation)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user