This commit takes care also of the percent operator

This commit is contained in:
AlbertoPellitteri
2021-05-24 10:43:48 +02:00
parent 2f9c045754
commit 832487fbe6

View File

@ -147,7 +147,7 @@ class CalculatorImpl(calculator: Calculator, private val context: Context) {
secondValue = getSecondValue()
calculateResult()
if (lastOperation == DIVIDE && secondValue == 0.0) {
if ( (lastOperation == DIVIDE || lastOperation == PERCENT) && secondValue == 0.0) {
lastKey = DIGIT
return
}