storing latitude and longitude

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • omerbutt
    Contributor
    • Nov 2006
    • 638

    storing latitude and longitude

    hi i am trying to store the longitude and latitude i have made the table with 3 columns codes, longitude , latitude and the type for longitude and latitude is decimal(15,11) but there are different lengths for the longitude and latitude value means some where it has 5 digits after decimal and somewhere 8 and when i save it in the table it places zeros for the values which do not have the length of 15 what should i do if i do not want to store extra zeros and only the exact value, temporarily i have changed it to varchar(255) :(
  • kovik
    Recognized Expert Top Contributor
    • Jun 2007
    • 1044

    #2
    Use a DOUBLE. It is more flexible than DECIMAL. DECIMAL is mostly for when you want to always round your values to a certain amount of decimal places. Like, money, for example.

    Comment

    Working...