calculatePercentage takes care of the use of the modulo operator

This commit is contained in:
AlbertoPellitteri 2021-05-24 12:17:12 +02:00
parent d09aa44f91
commit 9cc8ac9b54
1 changed files with 4 additions and 0 deletions

View File

@ -223,6 +223,10 @@ class CalculatorImpl(calculator: Calculator, private val context: Context) {
val partial = baseValue / (100 / secondValue) val partial = baseValue / (100 / secondValue)
baseValue.minus(partial) baseValue.minus(partial)
} }
PERCENT -> {
val partial = (baseValue % secondValue) / 100
partial
}
else -> baseValue / (100 * secondValue) else -> baseValue / (100 * secondValue)
} }
} }