There is a database with a table with columns:
| quantity | price | discount | *(количество|цена|скидка)
at recalculation of the sums taking into account a discount the sums turn out:
mysql_query( "SELECT SUM(price * quantity) AS summ FROM custom_item WHERE id_custom='$zakaz'", $db); 12 | 189.00 | 0% | = 2268.00 12 | 153.12 | 0% | = 1837.44 24 | 110.89 | 15% | = 2262.24
Everything works fine. But you need to calculate the amount of all orders, and I did this:
mysql_query( "SELECT SUM( (price * quantity)-(price * quantity * (discount/100)) ) AS summ FROM custom_item WHERE id_custom='$zakaz'", $db )
That's just when recalculating on a calculator it turns out like this:
2268.00 + 1837.44 + 2262.24 = 6367.68 ,
and when counts mysql = 6367.5959 , I round by function
number_format($myro2['0'], 2, '.', '');
and get 6367.60 . What's the matter, friends, how to solve the problem?