In a recent order, ubercart displayed the following:

Subtotal:	$194.95
UPS Ground:	$11.50
Subtotal excluding taxes: $206.45
Maryland Tax 6%:	 $11.70
Total:	$218.14

If you do the math and add up the line items, the total should be $218.15

I looked in the database and found the actual saved numbers

Subtotal:	$194.95
UPS Ground:	$11.49750
Subtotal excluding taxes: $206.4475 (my calculation)
Maryland Tax 6%:	 $11.69700
Total:	$218.14450

So it would seem there is an issue with rounding - perhaps the subtotal excluding taxes should not have utilized the rounded UPS value in it's calculation.

Comments

j.mead’s picture

possibly related issue with paypal orders here - http://drupal.org/node/882560 as I can confirm that rounding on the order total throws an error to my logs, but doesn't have any adverse effects

Island Usurper put up a patch specifically for the PayPal total component, maybe you can adapt the patch to apply where you're getting the error or maybe ask him to look into it?

ergophobe’s picture

Struggling with this too.

I've run a bunch of price/tax combos and the issue is simply this

- the tax line item is rounded.
- the order total is truncated.

So let's say you have this

order total: 95.00
shipping: 5.00
tax: 12.34567

You'll end up with
Tax: 12.35 (correct)
Order: 112.34 (truncated, rather than rounded).

For me it is always a 0.01 error, with the order total always being correct if tax is rounded down, and 0.01 low if tax is rounded up.

ergophobe’s picture

Okay so I have the same issue, but with the USPS module because it gets price quotes to three places past the decimal point and taxes are also carried out past the decimal point.

So in my order summary, it displays

Subtotal: $149.87
U.S.P.S. Parcel Post: $6.00
Subtotal excluding taxes: $155.87
CA Sales Tax: $12.74
Order total: $168.60 but it *should* be 168.61

But here's the thing, the *actual* values as stored by Ubercart are

U.S.P.S. Parcel Post: $5.995
CA Sales Tax: $12.73895

So order total = 168.60395 which rounds to 168.60

ergophobe’s picture

Status: Active » Closed (duplicate)

This is a dupe of #479784: Order rounding