|
decimal [(p [, s])] and numeric [(p [, s])]
Fixed precision and decimal places. With maximum precision, valid values range from-10 ^ 38 +1 to 10 ^ 38-1. SQL-92 synonyms for decimal are dec and dec (p, s). numeric is functionally equivalent to decimal.
p (accuracy)
Up to the total number of decimal digits that can be stored, including the digits to the left and right of the decimal point. The precision must be a value from 1 to a maximum precision of 38. The default precision is 18.
s (number of decimal places)
The maximum number of decimal digits that can be stored to the right of the decimal point. The number of decimal places must be a value from 0 to p. You can specify the number of decimal places only after specifying the precision. The default number of decimal places is 0; therefore, 0 <= s <= p. The maximum storage size varies based on accuracy.
Accuracy Stored bytes
1-9
5
10-19
9
20-28
13
29-38
17 |
|