I have a column DECIMAL(9,6) i.e. it supports values like 999,123456.
But when I insert data like 123,4567 it becomes 123,456700
How to remove those zeros?
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.
A
decimal(9,6)stores 6 digits on the right side of the comma. Whether to display trailing zeroes or not is a formatting decision, usually implemented on the client side.But since SSMS formats
floatwithout trailing zeros, you can remove trailing zeroes by casting thedecimalto afloat:prints:
(My decimal separator is a comma, yet SSMS formats decimal with a dot. Apparently a known issue.)