Problem Storing Latitude and Longitude values in MySQL database

前端 未结 7 877
逝去的感伤
逝去的感伤 2020-12-24 03:19

I want to store the values of latitude and longitude fetched from Google Maps GeoCoding API in a MySQL database. The values are in float format.

12.92

7条回答
  •  青春惊慌失措
    2020-12-24 04:12

    use double

    float lacks the necessary precision to save that number of digits after the decimal point. double, although not always guaranteed to have 7 decimal places for all numbers, will have where there are not more than 8 digits on the left of the decimal so should suit your needs.

提交回复
热议问题