I can't understand why my results are different:
I have table orders and column price (type double in mysql).
The price value in database is 13.5.
query:
SELECT ROUND(price * 0.09, 2) FROM orders where id = 1;
result is: 1.21
query:
SELECT ROUND(13.5 * 0.09, 2);
the result is 1.22
without rounding: SELECT 13.5 * 0.09
result is 1.215
so the correct result after round is 1.22.
Why query SELECT ROUND(price * 0.09, 2) FROM orders where id = 1;
gives me wrong result (1.21)?
I can't understand what's wrong, I guess something with casting.
Could someone explain me it?