I feel like I have learned something today. And I don't want to forget it. When a quantity is multiplied by a price, or hours by a rate, they should be rounded before added. When doing a query go like this
SELECT SUM(ROUND(quantity*price,2)) AS price_total
FROM invoice_item WHERE invoice_id = 1234
And that is how it should be done, and that's how quickbooks and probably other accounting systems do it. Rounding to the second decimal prevents values to the right of the second decimal being added to your totals which will make your totals too high by cents and dollars. This can also be done in spreadsheets using the same named ROUND function.