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.
float
is an inaccurate data type for representing price data. E.g. a receipt contains a total of4.50
butscanResults.total().value()
comes back as45.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.