News:

Support the VirtueMart project and become a member

Main Menu

Rounding error with coupon

Started by moose999, May 14, 2015, 11:54:34 AM

Previous topic - Next topic

moose999

Hi there,

If i have a product for 0.75 and i buy 3 of them that is 2.25. If i then use a 10% discount code VM removes 0.23 (10% of 2.25, rounded up). However, it (the cart) then shows the wrong overall total, 2.03.

2.03+0.23=2.26, not 2.25.

My problem with this is that numbers across the invoice don't tally. Personally I don't care if I get the 0.01 or if the shopper gets it, but the numbers need to be consistent.

I have attached a screengrab of the cart showing the problem.

Many thanks,
Justin

VM 3.0.9, J3.4.1

moose999

Hi there,

Has anyone else got any experience with these rounding errors?

Justin

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

moose999

Hi I think I understand why the numbers round like that, my problem with this is that numbers displayed on the invoice don't tally. Personally I don't care if I get the 0.01 or if the shopper gets it, but I need the numbers need to be consistent.

In my example the customer sees 2.25 - 0.23 = 2.03 and then complains :)

I am writing a plugin to integrate Virtuemart and the Xero accounting application, and due to the 2 decimal place limit on their systems, these rounded transactions are declared invalid because their totals do not add up. If VM could have a setting to calculate the grand total based on the 2 decimal place total of all the line items, then perhaps the (very common in the forums) complaints from people with confusion around rounding would go away?

Many thanks,
Justin