0

What database data type do I need to use to store a numerical value with 18 digits after the decimal place? I've tried double and float but it doesn't work it only shows 16 digits after the decimal place. I'm using MS SQL Server 2005 and 2008.

1 Answer 1

3

Assuming your values are not too big, you want to use DECIMAL. Something like DECIMAL(20, 18) (adjust the first value for the total number of digits in the number).

You can read about it here.

Sign up to request clarification or add additional context in comments.

2 Comments

What if the total number of digits vary?
@user1302054 . . . Just use a large enough value for the first digit . . . DECIMAL(30, 18) should be big and precise enough for most measurements.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.