Decimaltype i MySQL har to indstillingsknapper:præcision og skala. Du har udeladt skalaen, så den er som standard 0.
Dokumentation (link )
Eksempel
mysql> create table test01 (field01 decimal(9));
Query OK, 0 rows affected (0.01 sec)
mysql> insert into test01 (field01) values (123.456);
Query OK, 1 row affected, 1 warning (0.00 sec)
mysql> select * from test01;
+---------+
| field01 |
+---------+
| 123 |
+---------+
1 row in set (0.00 sec)
mysql> create table test02 (field01 decimal(9, 4));
Query OK, 0 rows affected (0.00 sec)
mysql> insert into test02 (field01) values (123.456);
Query OK, 1 row affected (0.01 sec)
mysql> select * from test02;
+----------+
| field01 |
+----------+
| 123.4560 |
+----------+
1 row in set (0.00 sec)