rounding mistake when using including VAT feature

Make comments, ask questions, or just complain about the software on this site. Or comment on any educational software.
Please note that by clicking on links that may appear in these posts that you may be leaving the Dale Harris Educational Software website and that the content of those sites is the sole resposibility of the authors of those sites.

Moderators:daleadmin, Dale Harris, Alan, Andrew

Post Reply
jake69
Forum Regular
Posts:42
Joined:Fri Nov 18, 2005 12:07 pm
Location:Vienna
Contact:
rounding mistake when using including VAT feature

Post by jake69 » Fri Apr 10, 2009 4:24 am

Dear Dale,

When I sell 3 items costing 2.99 per item including VAT (pricing set on including VAT), the total I get on the receipt is 8.98 .....

Best regards,
Attachments
rounding.jpg
rounding.jpg (110.08 KiB) Viewed 3914 times

User avatar
daleadmin
Forum Owner
Posts:1279
Joined:Tue Dec 30, 2003 9:47 pm

Re: rounding mistake when using including VAT feature

Post by daleadmin » Fri Apr 10, 2009 1:28 pm

Jake69,

This is a rounding error possibly cashed by using INT instead of FIX somewhere in the program. An interesting fact is that for the problem to occur the price must be an odd amout and you have to sell an odd amount of pieces. So a quick fix for you would be to sell the whatever at either 2.98 or 3.00 or only sell and even number of pieces. :)

This of course can be fixed for you. However since the computation of tax in the program can be compared to balancing an aircraft carrier on the point of a pin this means that the tax calculation for something else will probably go horribly wrong. This is how I fix a tax problem.

1. I find exactly what is causing the problem in a hundreds of lines of code.

2. I find some way to fix the problem.

3. I then test the problem using every possible way of setting up taxes with lots of different tax rates.

4. I ring up hundreds of sales while also calulating the sales on paper to see if they are correct. I do this for each possible set of tax parameters.

5. When I inevitably do find an error I go back to step #1.

6. END (Sure, like you can ever get here?)

This process takes forever. So while I may eventually fix this while not totally screwing up someone else's taxes it will be a while and will not be in the next version 7.02.

Dale

Post Reply

Who is online

Users browsing this forum: No registered users and 225 guests