wrong sum / price calculations with rounding error

29.02.2012 14:09
#1
annaimdunkeln
Joomshopping forum user no avatar
Name: anna h
24.10.2011
Сообщения: 2
Quote
wrong sum / price calculations with rounding error

i'm just setting up a webshop using joomla 1.7.2 & joomshopping 3.5.0. - the shop is still offline / locally installed, will go online once its ready.


there's a rounding error / calculation problem with one product (may be more):

price EUR 7,00 incl 20% tax -- joom shopping calculates the net price as EUR 5.83 and does not take into account that it actually is 5.83333

when ordering 10x this product, the calculations go wrong:
10x 7,00 = 70,00
10x 5.83 = 58,30 + 20% = 69,96


in pdf invoice & email & in the cart this is shown like this:

product name / 10 / 7,00 EUR inkl. 20% MwSt. / 70,00 EUR inkl. 20% MWSt.
sum: 69,96 EUR
shipping cost: 0,00 EUR
total incl tax: 69,96 EUR
incl 20% MWSt: 11,66 EUR



I urgently need help with this since I can't go online with a shop that calculates sums inaccurately AND displays two different sums within one calculation / invoice.

any way to solve this problem?

 
29.02.2012 16:32
#2
annaimdunkeln
Joomshopping forum user no avatar
Name: anna h
24.10.2011
Сообщения: 2
Quote
Aw: wrong sum / price calculations with rounding error

found a solution that seems to work ok by adapting smth i found in this forum... i'm not a programmer and quite frankly i'm just trying around.

pls include this or other solution to this problem in the next update!


In case sb has the same or similar problem, here's what I did:

in the database go to table xxxx_jshopping_products
there edit all fields that refer to prices (product_old_price product_buy_price product_price min_price) to decimal 12,4 (instead of 12,2)

if you now edit the prices in backend, they are saved with 4 decimals. Only 2 decimals show up in shop / cart / invoice etc. but it uses all 4 decimals for calculations. :-)

 


Copyrights MAXXmarketing GmbH. Alle Rechte vorbehalten
Durch die Nutzung dieser Website stimme ich zu, dass Cookies zur optimalen Gestaltung der Website sowie zur Analyse der Nutzung der Website verwendet werden. Weiterführende Informationen finden Sie hier. OK, einverstanden.