Forum Moderators: coopster
I'm using mysql and I need a table that reflects a float input. if I set the datatype to float, and input, say, 70.35, all is well. However, If I input something with a trailing zero (like 70.30) the final zero is stripped so I end up with 70.3.
My clients a real nit-pick, so he'll want the web display to show 70.30, and not 70.3.
Is there any datatype that will retain the trailing zero (and still be the correct data type for a float) rather than "text" or "varchar"?
Additionally, some small amount of math may need to be done via php when field contents are sent to variables - would selecting a datatype of "varchar" inhibit the ability to do mathmatical calculations?
Neophyte
Looking at the MySQL reference,
http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html [dev.mysql.com]
The numeric type 'decimal' may work as it allows you to set the number of decimal places stored.
Andrew