Post by tech1x10 » Wed Apr 10, 2013 3:46 am

Hello, I have a question about OpenCart rounding as per the example below:- Firstly, I should point out that I use an Excel spreadsheet to manage my products and pricing, I would therefore assume OpenCart uses the same mathematical formula:-

My tax (VAT) rate is set at 20% so for Product A:

Sell Price Ex Tax = £8.33
Sell Price Inc Tax = £9.99

The problem is that OpenCart rounds the Tax inc figure to £10 and I need it rounding down as per my Excel spreadsheet and that is also what is legally required in the UK. (I know we're only talking pennies but it is important from an advertising standards perspective).

I realise that the actual price inc tax is actually 8.33 x 1.2 = 9.996 but we can only charge to 2 decimal places so OpenCart changing the price to £10. Alternatively the price less tax is 9.99 / 1.2 = 8.325 hence £8.33

I would be very grateful if someone could explain how this problem could be solved.

Many thanks in advance.

Attachments

excel.JPG

excel.JPG (48.23 KiB) Viewed 1066 times


New member

Posts

Joined
Sat Dec 22, 2012 10:58 pm

Post by butte » Wed Apr 10, 2013 7:15 am

Try entering the prices to four digits (22.2222). That shifts the rounding trigger.

Guru Member

Posts

Joined
Wed Mar 20, 2013 6:58 am

Post by tech1x10 » Thu Apr 11, 2013 7:23 am

tech1x10 wrote:
I realise that the actual price inc tax is actually 8.33 x 1.2 = 9.996 but we can only charge to 2 decimal places so OpenCart changing the price to £10. Alternatively the price less tax is 9.99 / 1.2 = 8.325 hence £8.33

New member

Posts

Joined
Sat Dec 22, 2012 10:58 pm

Post by tech1x10 » Thu Apr 11, 2013 7:26 am

Thanks for the reply. So I understand this will work as per above, it's just that this won't make sense to the customer if they see a price of £8.325 on an invoice, they can only pay .33 or .32 it seems to be fundamentally down to the way OpenCart is rounding it's prices

New member

Posts

Joined
Sat Dec 22, 2012 10:58 pm

Post by butte » Thu Apr 11, 2013 9:52 am

Displays and invoices that customers see will ordinarily be to two digits. I would just tell them, in effect, that OC and money processor may differ by an entire halfpenny, even less or more, measurable in four farthings rounded down or up, and if money processor arithmetic yields rounding down or up relative to a halfpenny, then enjoy the two or suffer the four farthings. I understand that the approach may run amok of powers that be in at least some places in Europe, but somewhere in the mix must be a modicum of common sense about machines. Customers should understand that there was a time when pennies as well as halfpennies and farthings went along with crowns in the pockets, and nowadays rounding such as was suffered and learnt in school must be reckoned with, at once both without the lesser coins and with mere machines.

Guru Member

Posts

Joined
Wed Mar 20, 2013 6:58 am

Post by tech1x10 » Thu Apr 11, 2013 7:31 pm

oops yes thanks. It never actually occurred to me to check the customer side display of a 4 place rounded number i.e. 3.3252 is displayed correctly to the customer as 3.33 Once again apologies for this elementary mistake. I feel rather foolish now.

New member

Posts

Joined
Sat Dec 22, 2012 10:58 pm

Guru Member

Posts

Joined
Wed Mar 20, 2013 6:58 am
Who is online

Users browsing this forum: Baidu [Spider] and 8 guests