Stuart McLachlan
stuart at lexacorp.com.pg
Fri Jun 4 18:38:00 CDT 2004
On 4 Jun 2004 at 12:50, Jim Lawrence (AccessD) wrote: > Just thought I would add my comments to this discussion. > > There is always going to be round-off issue with numeric data. To keep these > problems to minimum it is advisable to process the round-off at the time of > entry. > > Given: A tax that is 7.5% of an invoice total. > When calculated, on say $115.18 the amount is total invoice is $123.8185 > with tax being $8.6385. The amount that will be paid is $123.82 with the > tax being $8.64. These are the two numbers that stored not the raw > uncalculated tax and invoice values. > > At the end of the fiscal year the tax totals can just be added and the > summary will perfectly match the invoice total. A value, in a database that > has to be added and then round-off performed will result in differences and > accumulative errors. > And use currency datatypes, because even with rounding of all individual values, you can still run into trouble with least significant bits in singles/doubles because of the way they are stored. -- Lexacorp Ltd http://www.lexacorp.com.pg Information Technology Consultancy, Software Development,System Support.