> Hello, so in short, rounding the column anywhere it is used, is
> another solution. I confirmed this below. Thanks, E. Pasma.
> 
> BEGIN;
> UPDATE fmtemp SET bal = ROUND(bal,2) + 123.45;
> (repeat a 1.000.001 times
> END;
> SELECT bal FROM fmtemp;
> 123450123.45

Absolutely not!  You should NEVER round the value and store it back in the 
datastore.  Rounding is ephemeral for the convenience of 
ugly-bags-of-mostly-water who are fixed in their world-view so that data can be 
DISPLAYED to them in a format that fits their limited view.  

You should NEVER round as you have done above.  You may get lucky and the 
errors may cancel each other out, or you may get more usual results where the 
error equals the theoretical max of the sum of the absolute value of all the 
truncated values, which can be quite significant depending on the scale of the 
number you are dealing with (and theior scales relative to each other).




Reply via email to