Menu

#22 Use of float arithmetic

open
nobody
None
5
2004-03-18
2004-03-18
No

The use of float arithmetic by Mercator could (should)
be considered a bug. Take for example tax amounts
such as 20.076865667, even the Total (cash in drawer
amount) can be easily persuaded to go into multiple
decimal places (try using alternative currency
conversion).

Use of floating point arithmentic in financial applications
is generally considered unacceptable. Just ask your
accountant, auditor, local tax office representative,bank
manager or even a business lawyer. They'll all agree.

Recomendation:

1. Convert to use NUMERIC(N,M) database types, and
use decimal arithmetic such as that provided by the IBM
decimal package (it's supposed to be much better than
than the standard Sun implementation).

2. Use integer storage (both in the database and
application) for monetary values with a fixed or currency
dependent multipler. Use the decimal package just for
formatting (if neccessary).

Discussion


Log in to post a comment.

MongoDB Logo MongoDB