mirror of
https://github.com/FossifyOrg/Calculator.git
synced 2026-05-19 03:45:18 -04:00
Fixed changing operator after dividing by zero (#202)
This commit is contained in:
@@ -118,8 +118,14 @@ class CalculatorImpl(calculator: Calculator, private val context: Context) {
|
||||
}
|
||||
}
|
||||
|
||||
lastKey = operation
|
||||
lastOperation = operation
|
||||
if (getSecondValue() == 0.0 && inputDisplayedFormula.contains("÷")) {
|
||||
lastKey = DIVIDE
|
||||
lastOperation = DIVIDE
|
||||
} else {
|
||||
lastKey = operation
|
||||
lastOperation = operation
|
||||
}
|
||||
|
||||
showNewResult(inputDisplayedFormula)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user