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.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
DECIMAL(2,1)means (as the manual suggests) a decimal of 2 characters wide (in total!) and 1 decimal. If you want10.0, you needDECIMAL(3,1)(three wide, one decimal).