Subject | Re: [ib-support] Really strange calculating behaviour of IB |
---|---|
Author | Geoff Worboys |
Post date | 2002-02-14T01:28:37Z |
>> For the moment I am just glad that I have not used scaled numericsAs DOUBLE PRECISION. All manipulations (both client and
>> in my apps - I just spend lots of time writing triggers etc to
>> perform explicit rounding. It may not be perfect, but so far it has
>> been consistent.
> And how do you store money-values ?
trigger/procedure) are written very carefully with explicit rounding
to the cent as required. The main area where potential problems can
creep in is doing a SUM() over a large number of records. But so far
this has not produced any problems.
It does increase the amount of code you have to write but it has been
reliable for me. One significant application involves payroll and
invoicing (so lots of currency values involved) and has been running
in production for almost two years without complaint about values
being inconsistent. (The application this replaced regularly had
rounding inconsistencies - and yes I wrote that one too ;-)
NOTE: So far I have not been involved with writing conversions
between currencies etc, so I have not had to deal with problems such
as scale 4 / scale 5 such as where you are having problems. The most
I have come against is scale 2 by scale 4 (then rounded back to scale
2), and in that instance I know the values are of a limited size.
I suspect that DOUBLE PRECISION (with precision limited to 15) could
present problems when performing scale 4 by scale 5 if the values
could get very large.
--
Geoff Worboys
Telesis Computing