mirror of
https://github.com/SimpleMobileTools/Simple-Calculator.git
synced 2025-02-08 23:58:42 +01:00
fixing some Equals related glitch
This commit is contained in:
parent
2ec342d4db
commit
998766e2e1
@ -241,11 +241,13 @@ class CalculatorImpl(calculator: Calculator, val context: Context) {
|
||||
}
|
||||
|
||||
fun handleEquals() {
|
||||
if (lastKey == EQUALS)
|
||||
if (lastKey == EQUALS) {
|
||||
calculateResult()
|
||||
}
|
||||
|
||||
if (lastKey != DIGIT)
|
||||
if (lastKey != DIGIT) {
|
||||
return
|
||||
}
|
||||
|
||||
val numberToCheck = if (inputDisplayedFormula.startsWith("-")) {
|
||||
inputDisplayedFormula.substring(1)
|
||||
@ -257,7 +259,8 @@ class CalculatorImpl(calculator: Calculator, val context: Context) {
|
||||
secondValue = getDisplayedNumberAsDouble()
|
||||
calculateResult()
|
||||
lastKey = EQUALS
|
||||
inputDisplayedFormula = displayedNumber ?: ""
|
||||
inputDisplayedFormula = displayedNumber ?: "0"
|
||||
baseValue = getDisplayedNumberAsDouble()
|
||||
}
|
||||
|
||||
private fun decimalClicked() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user