its because of rounding.
The real underlying price is likely 236.9883
it gets rounded to 236.99, but the math is done on the raw price.
100 * 236.9883 = 23698.83
It is a known issue in OpenCart that causes price match problems with paypal as well... tho I've not seen any expressed interest by Daniel to fix it.
Other topics:
http://forum.opencart.com/viewtopic.php?t=36916
http://forum.opencart.com/viewtopic.php?t=51687
http://forum.opencart.com/viewtopic.php?t=37837
Perhaps the fix can be made in the currency format function to round to 2 after currency exchange conversion, before the rest of the math. I'll have to look at it.
IIRC, It only happens for people with other currencies when other non-default currencies are in use.
The real underlying price is likely 236.9883
it gets rounded to 236.99, but the math is done on the raw price.
100 * 236.9883 = 23698.83
It is a known issue in OpenCart that causes price match problems with paypal as well... tho I've not seen any expressed interest by Daniel to fix it.
Other topics:
http://forum.opencart.com/viewtopic.php?t=36916
http://forum.opencart.com/viewtopic.php?t=51687
http://forum.opencart.com/viewtopic.php?t=37837
Perhaps the fix can be made in the currency format function to round to 2 after currency exchange conversion, before the rest of the math. I'll have to look at it.
IIRC, It only happens for people with other currencies when other non-default currencies are in use.
It simply is a calulating and roundig problem.
om most shops it is of no importance at all since only low volumes are bought and saleprice excl tax is calculated from price incl tax
problem starts when high volume of single products are purchased.
solution is pretty simple make it so oc can do the math correct.
now product price in admin is rounded at max 4 decimals wich is not enough for large numbers so it has to be 7 or 8 decimals
solution:
it can be changed with phpmyadmin
open your database an look for table products.
alter table price and change 15,4 in 15,7 (7 decimals)
now the price can have 7 decimals
now dont be lazy but input all decimals or for better living use the vqmod from uksitebuilder listed in this topic
http://forum.opencart.com/viewtopic.php?f=10&t=81408
it has to be altered to your needs and number of decimals
om most shops it is of no importance at all since only low volumes are bought and saleprice excl tax is calculated from price incl tax
problem starts when high volume of single products are purchased.
solution is pretty simple make it so oc can do the math correct.
now product price in admin is rounded at max 4 decimals wich is not enough for large numbers so it has to be 7 or 8 decimals
solution:
it can be changed with phpmyadmin
open your database an look for table products.
alter table price and change 15,4 in 15,7 (7 decimals)
now the price can have 7 decimals
now dont be lazy but input all decimals or for better living use the vqmod from uksitebuilder listed in this topic
http://forum.opencart.com/viewtopic.php?f=10&t=81408
it has to be altered to your needs and number of decimals
Koeltechnische deurrubbers eenvoudig online op maat bestellen.
Alle niet stekplichtige onderdelen zoals scharnieren, sloten, randverwarming en verlichting voor alle typen koelingen en vriezers.
https://koelcel-onderdelen.com
Where are you getting that from? It's perfectly accurate. Look at the calculations I posted.victorj wrote:It simply is a calulating and roundig problem.
The only issue would be the number of digits used to display the price with VAT which users can control if they really want.
-Ryan
I don't see how this helps. It just makes prices in Admin a huge unwieldy mess.Daniel wrote:just updated all prices from decimal(15,4) to decimal(15,8).
really not sure if this is going to cause errors though.
-Ryan
In Admin - Products - [item] - Data ....
Price: 2500.0000 [ I gave up changing this to what it should be 2500.00 - keeps adding extra two 00's when Save is clicked ]
Tax Class: None
No discount applied nor is the item on Special.
Shopfront
The Item shows as having a price of $2,091.25
Have problems with others product prices as well
ie - product item - Price: 900.0000 [ I gave up changing this to what it should be 900.00 - keeps adding extra two 00's when Save is clicked ]
Tax Class: None
In the Special tab, I have this product on Special for 500.0000 [ I gave up changing this to what it should be 500.00 - keeps adding extra two 00's when Save is clicked ]
Shopfront
The Item shows two prices $752.85 $418.25
Do I need to place an , (comma) between the 2 and 5 ie 2,500.00 or is there a bug in the system that is causing this.
Price: 2500.0000 [ I gave up changing this to what it should be 2500.00 - keeps adding extra two 00's when Save is clicked ]
Tax Class: None
No discount applied nor is the item on Special.
Shopfront
The Item shows as having a price of $2,091.25
Have problems with others product prices as well
ie - product item - Price: 900.0000 [ I gave up changing this to what it should be 900.00 - keeps adding extra two 00's when Save is clicked ]
Tax Class: None
In the Special tab, I have this product on Special for 500.0000 [ I gave up changing this to what it should be 500.00 - keeps adding extra two 00's when Save is clicked ]
Shopfront
The Item shows two prices $752.85 $418.25
Do I need to place an , (comma) between the 2 and 5 ie 2,500.00 or is there a bug in the system that is causing this.
Have a great day everyone
It is accurate except that the conversion from 4 precision to 2 is the problem. I think part of it comes down to the way all prices are calculated first, then after all math is done, it coverts the final price.rph wrote:Where are you getting that from? It's perfectly accurate. Look at the calculations I posted.victorj wrote:It simply is a calulating and roundig problem.
The only issue would be the number of digits used to display the price with VAT which users can control if they really want.
So for example, if you have 2 currencies USD and EUR
USD is 1.000000000
EUR is 0.783637682
The product is 100
option +2.10
discount -1.25
= 100.85
converted to EUR is: (100.85 * 0.783637682) = 79.0298602297
rounded to 2 is 79.03
But if you converted each price first, before the math:
product is (100 * 0.783637682) = 78.3637682
option +(2.10 * 0.783637682) = 1.6456391322
discount is (-1.25 * 0.783637682) = 0.9795471025
Total = 80.9889544347
rounded to 2 is 80.99
Which is more correct?
Issue Resolvedblurb wrote:In Admin - Products - [item] - Data ....
Price: 2500.0000 [ I gave up changing this to what it should be 2500.00 - keeps adding extra two 00's when Save is clicked ]
Tax Class: None
No discount applied nor is the item on Special.
Shopfront
The Item shows as having a price of $2,091.25
Have problems with others product prices as well
ie - product item - Price: 900.0000 [ I gave up changing this to what it should be 900.00 - keeps adding extra two 00's when Save is clicked ]
Tax Class: None
In the Special tab, I have this product on Special for 500.0000 [ I gave up changing this to what it should be 500.00 - keeps adding extra two 00's when Save is clicked ]
Shopfront
The Item shows two prices $752.85 $418.25
Do I need to place an , (comma) between the 2 and 5 ie 2,500.00 or is there a bug in the system that is causing this.
When I was setting up the store I removed all countries except NZ and USA
After pulling all my hair out over the last couple of days I thought I would get rid of the USA currency
This fixed the issue for my store
I'm starting to love opencart again
Have a nice day folks
Have a great day everyone
Definitely not the second one since you added the discount instead of subtracting it.Qphoria wrote:It is accurate except that the conversion from 4 precision to 2 is the problem. I think part of it comes down to the way all prices are calculated first, then after all math is done, it coverts the final price.rph wrote:Where are you getting that from? It's perfectly accurate. Look at the calculations I posted.victorj wrote:It simply is a calulating and roundig problem.
The only issue would be the number of digits used to display the price with VAT which users can control if they really want.
So for example, if you have 2 currencies USD and EUR
USD is 1.000000000
EUR is 0.783637682
The product is 100
option +2.10
discount -1.25
= 100.85
converted to EUR is: (100.85 * 0.783637682) = 79.0298602297
rounded to 2 is 79.03
But if you converted each price first, before the math:
product is (100 * 0.783637682) = 78.3637682
option +(2.10 * 0.783637682) = 1.6456391322
discount is (-1.25 * 0.783637682) = 0.9795471025
Total = 80.9889544347
rounded to 2 is 80.99
Which is more correct?
-Ryan
blurb wrote:In Admin - Products - [item] - Data ....
Price: 2500.0000 [ I gave up changing this to what it should be 2500.00 - keeps adding extra two 00's when Save is clicked ]
Tax Class: None
No discount applied nor is the item on Special.
Shopfront
The Item shows as having a price of $2,091.25
Have problems with others product prices as well
ie - product item - Price: 900.0000 [ I gave up changing this to what it should be 900.00 - keeps adding extra two 00's when Save is clicked ]
Tax Class: None
In the Special tab, I have this product on Special for 500.0000 [ I gave up changing this to what it should be 500.00 - keeps adding extra two 00's when Save is clicked ]
Shopfront
The Item shows two prices $752.85 $418.25
Do I need to place an , (comma) between the 2 and 5 ie 2,500.00 or is there a bug in the system that is causing this.
you need to set more than 2 0's after decimal points to make the pricing more accreate
OpenCart®
Project Owner & Developer.
I really think this issue should be resolved as it shows wrong prices to customers and headaches for accountants.
You can also replicate this bug on OC demo page too. Just put 100 iPhones in your cart, and check the cart page.
What you will get is following:
Unit price: $120.68 x 100 = $12,067.50 that is clearly wrong.
If someone can produce extension that fix this bug I'm more than happy to buy this extension.
You can also replicate this bug on OC demo page too. Just put 100 iPhones in your cart, and check the cart page.
What you will get is following:
Unit price: $120.68 x 100 = $12,067.50 that is clearly wrong.
If someone can produce extension that fix this bug I'm more than happy to buy this extension.
Use the BC math PHP functions to do calculus and avoid propagation of error precision on float numbers.
Using a string representation of numbers is 20x slower than normal math functions, but give good results.
Using a string representation of numbers is 20x slower than normal math functions, but give good results.
Who is online
Users browsing this forum: No registered users and 40 guests