Топ-100
 

DECIMAL

RDBMS Type: MySQL
Topic

DECIMAL[(M[,D])] [UNSIGNED] [ZEROFILL]

A packed "exact" fixed-point number. M is the total number of digits
(the precision) and D is the number of digits after the decimal point
(the scale). The decimal point and (for negative numbers) the - sign
are not counted in M. If D is 0, values have no decimal point or
fractional part. The maximum number of digits (M) for DECIMAL is 65.
The maximum number of supported decimals (D) is 30. If D is omitted,
the default is 0. If M is omitted, the default is 10. (There is also a
limit on how long the text of DECIMAL literals can be; see
https://dev.mysql.com/doc/refman/8.0/en/precision-math-expressions.html
.)

UNSIGNED, if specified, disallows negative values. As of MySQL 8.0.17,
the UNSIGNED attribute is deprecated for columns of type DECIMAL (and
any synonyms) and support for it will be removed in a future MySQL
version. Consider using a simple CHECK constraint instead for such
columns.

All basic calculations (+, -, *, /) with DECIMAL columns are done with
a precision of 65 digits.

URL: https://dev.mysql.com/doc/refman/8.0/en/numeric-type-syntax.html

Example