I have a column in MySQL with the type DECIMAL(2,1). When I insert the number 10 into the database it reads 9.9. I want it to read 10.0. Any ideas? Thanks.
1 Answer
DECIMAL(2,1)
means (as the manual suggests) a decimal of 2 characters wide (in total!) and 1 decimal. If you want 10.0
, you need DECIMAL(3,1)
(three wide, one decimal).