In my db table I have a field float where I store cost of a project if I insert cost 4559006 is saved like 4.55901e+006 and when I perform mathematics operation on it it produces errors.
How could I fix it?
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.
Floating point types are not suitable for precise calculations
Use
decimal(15,2)15 is the number of significant digits including scale 2. You can increase that up to 65 if needed.
http://dev.mysql.com/doc/refman/5.1/en/fixed-point-types.html