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)
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue