Syntax\n------\n\nDECIMAL[(M[,D])] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA 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).\n\n The decimal point and (for negative numbers) the "-" sign are not counted in M.\n If D is 0, values have no decimal point or fractional part, and on INSERT, the value will be rounded to the nearest DECIMAL.\n The maximum number of digits (M) for DECIMAL is 65.\n The maximum number of supported decimals (D) is 30 before MariadB 10.2.1 and 38 afterwards.\n If D is omitted, the default is 0. If M is omitted, the default is 10.\n\nUNSIGNED, if specified, disallows negative values.\n\nZEROFILL, if specified, pads the number with zeros, up to the total number of digits specified by M.\n\nAll basic calculations (+, -, \\, /) with DECIMAL columns are done with a precision of 65 digits.\n\nFor more details on the attributes, see Numeric Data Type Overview.\n\nDEC, NUMERIC, and FIXED are synonyms, as well as NUMBER in Oracle mode.\n\nExamples\n--------\n\nCREATE TABLE t1 (d DECIMAL UNSIGNED ZEROFILL);\n\nINSERT INTO t1 VALUES (1),(2),(3),(4.0),(5.2),(5.7);\nQuery OK, 6 rows affected, 2 warnings (0.16 sec)\nRecords: 6  Duplicates: 0  Warnings: 2\n\nNote (sql 1265): Data truncated for column 'd' at row 5\nNote (sql 1265): Data truncated for column 'd' at row 6\n\nSELECT * FROM t1;\n+------------+\n| d          |\n+------------+\n| 0000000001 |\n| 0000000002 |\n| 0000000003 |\n| 0000000004 |\n| 0000000005 |\n| 0000000006 |\n+------------+\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/decimal