Let's say the value is stored in a column "Price" like so:
ItemNo | Price
-------------------
1 94.2348723
2 83.3821974
To round the figures correctly in MySQL, use the following:
SELECT `ItemNo`, Truncate(SUM(`Price`) + 0.0051,2) AS Price
It should now be correctly rounded to 2 decimal places!
No comments:
Post a Comment