mirror of
https://github.com/SimpleMobileTools/Simple-Calculator.git
synced 2025-02-16 19:40:48 +01:00
Merge pull request #208 from AlbertoPellitteri/fix-mod-wrong-result
Fix percentage calculation after mod result
This commit is contained in:
commit
7b949804e4
@ -228,6 +228,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…
x
Reference in New Issue
Block a user