mirror of
https://github.com/SimpleMobileTools/Simple-Calculator.git
synced 2025-02-01 16:36:53 +01:00
calculatePercentage takes care of the use of the modulo operator
This commit is contained in:
parent
d09aa44f91
commit
9cc8ac9b54
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user