mirror of
https://github.com/SimpleMobileTools/Simple-Calculator.git
synced 2025-02-23 23:07:39 +01:00
Fixed issue #261 of 0√
Cause : lastKey was not updated when newValue became "". Hence lastKey validation at line 95 failed.
This commit is contained in:
parent
983b645ce3
commit
9e6e3b4057
@ -324,8 +324,9 @@ class CalculatorImpl(
|
|||||||
val lastDeletedValue = inputDisplayedFormula.lastOrNull().toString()
|
val lastDeletedValue = inputDisplayedFormula.lastOrNull().toString()
|
||||||
|
|
||||||
var newValue = inputDisplayedFormula.dropLast(1)
|
var newValue = inputDisplayedFormula.dropLast(1)
|
||||||
if (newValue == "") {
|
if (newValue == "" || newValue == "0") {
|
||||||
newValue = "0"
|
newValue = "0"
|
||||||
|
lastKey = CLEAR
|
||||||
} else {
|
} else {
|
||||||
if (operations.contains(lastDeletedValue) || lastKey == EQUALS) {
|
if (operations.contains(lastDeletedValue) || lastKey == EQUALS) {
|
||||||
lastOperation = ""
|
lastOperation = ""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user