DECIMAL[(M[,D])] [UNSIGNED] [ZEROFILL] : Decimal « Data Types « MySQL Tutorial






A packed exact fixed-point number.

M is the total number of digits.

D is the number of digits after the decimal point.

The decimal point and (for negative numbers) the '-' sign are not counted in M.

The maximum number of digits (M) is 65.

The maximum number of decimals (D) is 30.

If D is omitted, the default is 0.

If M is omitted, the default is 10.

DEC[(M[,D])] [UNSIGNED] [ZEROFILL], NUMERIC[(M[,D])] [UNSIGNED] [ZEROFILL], FIXED[(M[,D])] [UNSIGNED] [ZEROFILL] are synonyms for DECIMAL.
10.8.Decimal
10.8.1.DECIMAL[(M[,D])] [UNSIGNED] [ZEROFILL]
10.8.2.DECIMAL(7,2)
10.8.3.For inserts into a DECIMAL or integer column