BlinkReceipt / blinkreceipt-android

MIT License
49 stars 16 forks source link

Float data types are inaccurate for prices #3

Closed ex-nerd closed 3 years ago

ex-nerd commented 6 years ago

float is an inaccurate data type for representing price data. E.g. a receipt contains a total of 4.50 but scanResults.total().value() comes back as 45.00002, 44.999998, or some other similar problematic value.

Instead, BigDecimal should be used for data like monetary values where decimal point precision is important.