Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
$5 difference due to rounding?
Message
De
15/11/2006 16:46:08
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
14/11/2006 17:56:12
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., Nouvelle Zélande
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01169448
Message ID:
01170083
Vues:
19
>Fabio,
>
>The trouble is that there are already precalculated values in a N(9,2) field. I was just trying to show the sorts of cumulative rounding errors that can result.
>
>I've seen it before- when using a UK copy of Quickbooks in Australia or New Zealand, sales tax is calculated wrongly because it is calculated on a line-by-line basis rounded to 2 decimal places, giving cumulative rounding errors, rather than as single calculation of the grand total.

This is where I had to learn to think like an accountant. And accountants don't care about cumulative rounding errors - every accountant knows where to stash them. They do care about totals matching, and if there's a single cent mismatch, they'll sit on your neck until it matches.

The solution is what I wrote in the other message here - whatever monetary amount you need to calculate, store it in a separate field in the detail record. Don't apply any percentages to totals - total the calculated values, and don't care about rounding errors, they'll mostly cancel themselves out. If anybody tries to apply a percentage to your total, they'll get a result quite close to what your total of calculated amounts shows, and they usually won't do that. They will, however, become very loud if the totals don't match. So, precision be damned, do it the way they like it.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform