I’m using entity framework and mysql as a backend.
I have an entity that has lat and long which are of type float.
Let’s say the values are lat:45.50818 and long:-73.55409
after the insert in the db the values in the DB are lat:45.508183 and
long:-73.554092
in the db the type is float (10,6)
where does the extra 3 and 2 coming from?
Also when I query the db my entity contains the correct lat/long …
Any help is appreciated,
Thank you
you should use decimal data type instead
Flaoting point numbers are only approximate numbers. Defining
float(10,6)means only that you can store that precision but the number may be inaccurate after that precision. Fixed-point numbers don’t have that problem.