mirror of
https://github.com/SimpleMobileTools/Simple-Calculator.git
synced 2025-06-05 21:49:13 +02:00
fixing some Equals related glitch
This commit is contained in:
@@ -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() {
|
||||
|
Reference in New Issue
Block a user