[GNC] Invoice tax rouding issue in 2.x

Matthew Pounsett matt at conundrum.com
Tue May 22 21:11:26 EDT 2018


I've got an off-by-a-cent error on an invoice due to the way taxes are
calculated.  GnuCash (2.6.21) is calculating the tax on each individual
taxable item, then summing that up, and adding that value to the subtotal.
This causes an error because each individual tax calculation is rounded
prior to subtotalling.

Given a tax rate of 13%, GnuCash is doing this:

            Item     Tax
          277.50   36.08
           92.50   12.03
Subtotal: 370.00 + 48.11 = 418.11

When the real calculation should be:

            Item      Tax
          277.50   36.075
           92.50   12.025
Subtotal: 370.00 + 48.100 = 418.10

This could be fixed by GnuCash not rounding tax amounts until the final
total, but typically I believe the calculation done is to add up all the
taxable items and apply the tax calculation to that subtotal, so that it's
not necessary to track many decimal places to avoid a rounding error.

I did some searching through the mailing lists and I see a lot of reported
issues about rounding errors in GnuCash 2.x.  I can work around this by
putting in an extra line item to correct the taxes, but it would be nice
not to have to do that.  Is this something that's been fixed in 3.x?  I've
been avoiding the update because I haven't had time for a careful
migration, and testing whether I'm affected by any of the various issues
that have been reported since its release.  But, this might be a reason to
set that time aside.


More information about the gnucash-user mailing list