Unwanted number rounding when inserting into database
Having a brain fart here and not sure what to do....I'm using a function in a class to insert prices into a database table, and I'm using number_format($price, 2, '.', ',') in order to make sure it's correct. However when it goes into my table, a value like 19.38 will change to 19.00 and a value like 7.07 will come out like 7.00. In other words, it's rounding the numbers and that cannot happen as these are exact prices that need to be correct. I'm using the format of DECIMAL(10,2) in my table field - I assumed this was the right one to use? If anyone can shed some light onto why it is auto rounding my numbers I would be grateful.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread