What would be the best way to set my SQL field for a value such as $34,000.
My SQL is: price DECIMAL(4,2) and it seems I can only output 34.00. How could I also make it show with a , not a . (could possibly be to due my cms stripping data)
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.
For $34,000 you need DECIMAL(7,2), five digits before the decimal point, two after.
And think about if you really need to be so restrictive. Two decimals after the point makes sense, but you want to err on the safe side with the total number, otherwise you cannot store say, $1,000,000, in your database.