mirror of
https://github.com/FossifyOrg/Calculator.git
synced 2026-05-19 03:45:18 -04: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:
@@ -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 = ""
|
||||
|
||||
Reference in New Issue
Block a user