Question

I am importing a table into a phpmyadmin database as a .CSV file, the file has some values within it which are greater than 100 for example 284.543536, 694.5435432, etc... When I import the file all values under 100 get imported fine and show on the table as expected however, the values over 100 get changed to 99.99999999. I have tried to find a solution for this but am struggling, could someone please explain to me why this keeps happening.

Was it helpful?

Solution

Your column is set to only allow two decimal places before the dot causing your values to be truncated. You will need to change it to allow higher numbers. decimal(10,7) would solve this issue for the numbers you have used in your example but if you plan on getting values over 1000 you will need to adjust this further.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top