CottaCush / CurrencyEditText

💰 A library to dynamically format your EditTexts to take currency inputs
Apache License 2.0
131 stars 28 forks source link

Fix: Rounding Error On Display During Entry #18

Closed efguydan closed 3 years ago

efguydan commented 3 years ago

This Pull Request fixes Double's problem with accurately storing 1.0E23 in memory, storing 9.99999999999E22 instead. This is fixed by changing the parsed number during entry to BigDecimal from Double. BigDecimal doesn't have a problem with storing 1.0E23 or any other number in memory accurately, fixing this problem.

Another plus that comes with this fix is; Double has a limit of 1.0E308, which returns infinity after this point. BigDecimal can store as many numbers as you can type.

Fixes #17

rasheedsulayman commented 3 years ago

Do you maybe know the implication of using BigDecimal? i.e how heavy/slow is it.