Merge pull request #267 from rsb-23/Issue-#261-fix

Fixed issue #261 of 0√
This commit is contained in:
Tibor Kaputa 2022-07-04 10:35:35 +02:00 committed by GitHub
commit 7e33f9a7e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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 = ""