Precision on Latitude/Longitude

Hi All,

I’m having a problem with Rails truncating latitude and longitude
values. In my database (mySQL) table, my lat/lng columns are defined as
Decimal(25,20), but I get different precision values depending on what I
do. If I post, via XML, a value of 37.436490000000006 to my controller,
what gets inserted into the db table is 37.43648999999999900000. Then,
when I fetch the record in a controller and render it out to an XML
file, I get 37.43649.

Is there another datatype I should be using in my database table, or is
there something I can do on the Rails side to force the precision.

Thanks in advance for any help you can offer.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs