manuelbl / SwissQRBill

Java library for Swiss QR bill payment slips (aka QR-Rechnung)
https://www.codecrete.net/qrbill
MIT License
157 stars 38 forks source link

Question concerning the bill amount as Double value #5

Closed marcelbaumann closed 5 years ago

marcelbaumann commented 6 years ago

I was slightly surprised that the type of QRBill amount in the "Bil"l class is Double. I was expected a BigDecimal. It seems to be that we have a potential accounting problem. Or I am wrong?

manuelbl commented 6 years ago

I am aware of it. But it isn't a real problem: the library does not calculate anything, a Double is more than sufficient to represent the maximum value allowed in QR bills and the value is always printed with two decimal places (correctly rounded).

Currently, I'm in the process of make major changes to implement version two of the QR bill specification released last week. I will revisit the decision to use a Double. By next week, I plan to have a release candidate.

manuelbl commented 5 years ago

I've now switched to BigDecimal in version 2.