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
1 changed files with 2 additions and 1 deletions
|
@ -324,8 +324,9 @@ class CalculatorImpl(
|
|||
val lastDeletedValue = inputDisplayedFormula.lastOrNull().toString()
|
||||
|
||||
var newValue = inputDisplayedFormula.dropLast(1)
|
||||
if (newValue == "") {
|
||||
if (newValue == "" || newValue == "0") {
|
||||
newValue = "0"
|
||||
lastKey = CLEAR
|
||||
} else {
|
||||
if (operations.contains(lastDeletedValue) || lastKey == EQUALS) {
|
||||
lastOperation = ""
|
||||
|
|
Loading…
Reference in a new issue