I have an items
table in my MySQL database with a DECIMAL(10,2)
field called price
.
When fetching these values, is it safe to do calculations and such with these numbers in PHP? Or will I end up with potential rounding errors and things like that which are common when working with floating point data types?
How does PHP handle these things behind the cover? Is it safe to do money calculations with PHP?