Suppose that your column is set to be
DECIMAL(13,4)
. This means that the column will have a total size of 13 digits where 4 of these will be used for precision representation.
The declaration syntax for a
DECIMAL
column is DECIMAL(M
,D
)
. The ranges of values for the arguments are as follows:M
is the maximum number of digits (the precision). It has a range of 1 to 65.D
is the number of digits to the right of the decimal point (the scale). It has a range of 0 to 30 and must be no larger thanM
.DECIMAL
columns do not store a leading+
character or-
character or leading0
digits. If you insert+0003.1
into aDECIMAL(5,1)
column, it is stored as3.1
. For negative numbers, a literal-
character is not stored.DECIMAL
columns do not permit values larger than the range implied by the column definition. For example, aDECIMAL(3,0)
column supports a range of-999
to999
. ADECIMAL(
column permits at mostM
,D
)M
-D
digits to the left of the decimal point.