1

When use numeric type, for example like this numeric(4,2) and if store in him number 1.2, at end of number are adding zeros for filling scale part right? that is result is 1.20

There is possible to save "short" scale as "short"? that is without adding zeros at end ?

1 Answer 1

4

You shouldn't worry about extra space used for scale part.

According to documentation values of numeric type saved without trailing zeroes:

Numeric values are physically stored without any extra leading or trailing zeroes. Thus, the declared precision and scale of a column are maximums, not fixed allocations. (In this sense the numeric type is more akin to varchar(n) than to char(n).) The actual storage requirement is two bytes for each group of four decimal digits, plus three to eight bytes overhead.

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

Comments

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.