mirror of
https://github.com/SimpleMobileTools/Simple-Calculator.git
synced 2025-06-05 21:49:13 +02:00
calculatePercentage takes care of the use of the modulo operator
This commit is contained in:
@ -223,6 +223,10 @@ class CalculatorImpl(calculator: Calculator, private val context: Context) {
|
||||
val partial = baseValue / (100 / secondValue)
|
||||
baseValue.minus(partial)
|
||||
}
|
||||
PERCENT -> {
|
||||
val partial = (baseValue % secondValue) / 100
|
||||
partial
|
||||
}
|
||||
else -> baseValue / (100 * secondValue)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user