mirror of
https://github.com/FossifyOrg/Calculator.git
synced 2026-05-01 11:17:27 -04: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