I want to store 3.50 into a mysql table. I have a float that I store it in, but it stores as 3.5, not 3.50. How can I get it to have the trailing zero?
Do not store money values as float, use the DECIMAL or NUMERIC type:
Documentation for MySQL Numeric Types
EDIT & clarification:
Float values are vulnerable to rounding errors are they have limited precision so unless you do not care that you only get 9.99 instead of 10.00 you should use DECIMAL/NUMERIC as they are fixed point numbers which do not have such problems.
1.4m articles
1.4m replys
5 comments
57.0k users