mirror of
https://github.com/SimpleMobileTools/Simple-Calculator.git
synced 2025-06-05 21:49:13 +02: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
|
if (getSecondValue() == 0.0 && inputDisplayedFormula.contains("÷")) {
|
||||||
lastOperation = operation
|
lastKey = DIVIDE
|
||||||
|
lastOperation = DIVIDE
|
||||||
|
} else {
|
||||||
|
lastKey = operation
|
||||||
|
lastOperation = operation
|
||||||
|
}
|
||||||
|
|
||||||
showNewResult(inputDisplayedFormula)
|
showNewResult(inputDisplayedFormula)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user