I think you misunderstand the floats. I do not mean that patronizingly, most people misunderstand floats, unfortunately.
Floating-point numbers are able to “re-scale” themselves. The ability to store huge numbers or tiny digits in the same data type. This does not mean that they are "infinitely accurate." It just means that they have an extreme range that they can cover. However, they pay for such flexibility. They have a rounding error because they are binary approximations of decimal numbers.
If you want to know more about this, there are many on the Internet. At first it gets confused with people, but as soon as you realize that you will be better, safer and wiser.
So, for your case, if you want to keep the exact value, do not use the floating point data type. Instead, use a fixed point data type.
If you change the value from FLOAT to something like DECIMAL(9,4) , then you will not get rounding errors associated with floating point numbers.
You cannot save 0.12345 in it, but for this you need to specify DECIMAL(9,5) . But you will always be guaranteed that any number that you can store in it will be stored accurately, and not approximately.
source share