DEC, DECIMAL, FIXED, NUMERIC
DECIMAL[(width[,decimals])] [UNSIGNED] [ZEROFILL]
This data column type is similar to FLOAT,
but it’s used for accurate, fixed-point numbers. When calculating with
a DECIMAL column, it has a 65-digit level of
precision. The width given is the maximum width of the total digits—on
both sides of the decimal place, not including the decimal point or
the negative sign if a negative number. The decimals given are the
number of decimals allowed and the number for which it zero-fills. For
example, a column type setting of DECIMAL(4,2) that
is given a value of 123.4 will return a warning and store the value as
99.99, the maximum amount given the width. If the same column is given
a value of 12.3, it won’t generate any warnings and will store the
value as 12.30. If UNSIGNED is used with
DECIMAL, negative values are not allowed.
MySQL stores numbers in DECIMAL columns as
strings. Therefore, numbers outside the maximum numeric range for this
data type may be stored in a DECIMAL column. This
data type may be retrieved and displayed as a string, but in a numeric
context (i.e., as part of a calculation), it cannot exceed the values
shown in the table.