Well, I am wondering about a thing with rounding decimals, and storing them in DB.
Problem is like this:
Let's say we have a customer and a invoice.
The invoice has total price of $100.495 (due to some discount percentage which is not integer number), but it is shown as $100.50 (when rounded, just for print on invoice). It is stored in the DB with the price of $100.495, which means that when customer makes a deposit of $100.50 it will have $0.005 extra on the account. If this is rounded, it will appear as $0, but after couple of invoices it would keep accumulating, which would appear wrong (although it actually is not).
What is best to do in this case. Store the value of $100.50, or leave everything as-is?