Floating-point numbers are typically used to represent numeric values that contain fractional parts. When a field is defined as a floating-point type, if the precision of the inserted data exceeds the actual precision defined by the column, the insertion value is rounded to the actual defined precision value, and then inserted
The rounding process is not an error. float, double (or real) is used in MySQL to represent floating-point numbers.
Fixed-point numbers are different from floating-point numbers, and the fixed-point number is actually stored as a string, so the fixed-point number can save data more accurately.
mysql> CREATE TABLE Test (C1 float (10,2), C2 decimal (10,2));
Query OK, 0 rows affected (0.29 sec)
mysql> INSERT into test values (199999.82,199999.82);
Query OK, 1 row affected (0.07 sec)
Mysql> select * from test;
+-------------+-------------+
| C1 | C2 |
+-------------+-------------+
| 199999.81 | 199999.82|
+-------------+-------------+
MySQL floating-point and fixed-point numbers