Maps latitude & longitude what type must by in mysql table,... double or float

Maps latitude & longitude what type must by in mysql table,… double or float…or… ? I need 12.123456 over 5 decimal digits to the right of dot…

For Lat and Long in a table I use the “Decimal” data type to store the figure as decimal degrees. That is better suited to database storage than degrees & minutes or deg, mins, seconds. If you do need those formats, you can convert the value with a bit of maths.
To use 5 decimal places, use decimal(8,5) where 8 is the total number of digits and 5 is the decimal places.
Using 8 will allow for 3 figures before the decimal for the longitude, as that has a maximum value of 180 degrees. Though you could use 2 figures before the decimal if you can be certain that all locations will be close enough to the Greenwich Meridian (within 99 degrees). You only need 2 digits before the decimal for latitude with a max value of 90 degrees. So you may get away with decimal(7,5)

so if using phpmyadmin use in type DECIMAL, and in value 8,5

That do??

what happened when you tested it? ™

Yes, that should cover all the globe, allowing 3 digits before to decimal and 5 after it, Eg: 124.46782
You will also need negative values which this format will allow.

I didn’t test it! ™

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.