OK, I have designed an inventory / accounting program for my work which tracks all purchases and categorizes them into different departments.
Some of the items, however, split across multiple categories (eg. celery purchases split 20% into chili, 25% into chowder, 50% into soup, 5% into misc. food), thus creating an amount of something like $12.155 into a particular category. Since I need to reduce the number to 2 decimal places for our accountant, that example would become $12.16. Therefore, when all the numbers for all the departments are added together, they do not match because of the odd penny.
I tried truncating the numbers, but I get a similar problem because they can now be LOWER by a penny or two. Then I attempted to add or subtract the difference from the original invoice total with the department breakdown, but that caused a circular reasoning error.
So what method could I utilize to deal with this issue? Any help would be truly appreciated.
Bookmarks