Taking care of the pennies. Rounding errors!

Mike or Penny Novack mpnovack at mtdata.com
Sun Nov 1 08:58:47 EST 2015


On 10/31/2015 4:47 PM, John Whitmore wrote:
> While I'm here I'm afraid I have to ask another question.
>
> Should I worry about rounding errors? I'll explain my specific situation.
>
> I bought items for a total of 201.51 Euros
> That total included UK Vat at a rate of 20%
>
> I create an invoice for the vendor:
>
> Unit price 201.51 euros
> Taxable
> Tax Included
> Tax Table Vat @ 20%
>
>
>
> That creates a calculated sub total of 167.93 Euros
There is no general solution to this problem. It's not a bug but a 
consequence of both mathematical reality and possibly jurisdictional rules.

a) the math problem:  rounded(a) + rounded(b) does not equal 
rounded(a+b)    << not necessarily >>

b) the jurisdictional problem: Although "sales tax" (of which VAT is an 
example) are usually expressed as a percent, each jurisdiction gets to 
make rules about how the fractions of the smallest legal money are to be 
treated. Some use rounding. Some us floor or ceiling (for example, a 
rule like "round UP to the nearest whole cent" ---- so if the percent 
calculation  gives a tax amount of $3.431 the tax owed is $3.42). Now 
this CAN be coded and "point of sales" systems have to cope, but that 
means specific coding FOR EACH JURISDICTION. That has to take into 
account what is taxable and what is not, which can be fairly complicated 
(for example, in my jurisdiction, items of clothing costing less than 
$200 aren't taxed --- that's by item, not the total sale).

    In use, a "point of sales" application would feed the accounting 
application. In other words, the specific code would not be in the 
accounting package. I am still over simplifying the problems. For 
example, provision needs to be there for entering a "tax exempt" code to 
override the tax calculation if the purchase is for an organization that 
has tax exemption. I do not know if anybody in the free software world 
is working on a "point of sales" application. If so, their forum would 
be bombarded with requests "please add our jurisdiction's rules".

Michael


More information about the gnucash-user mailing list