views:

132

answers:

1

I have the strangest experience using taps to move data between my machine and Heroku.

It works fine except that it seems to lose 0s directly behind the decimal place for my geo coordinates i.e. 50.0519322 for some reason gets set to 50.519322... no idea why.

When I pull the data from the remote location ie. heroku db:pull... it works fine, all decimal places intact on my machine, however, when I push it back to the remote server it loses these zeros. Especially directly behind the decimal place, though I haven't noticed it elsewhere yet.

At first I was storing the lat and lng as simply numeric but refined it to:

change_column :places, :lat, :numeric, :precision => 15, :scale => 10
change_column :places, :lng, :numeric, :precision => 15, :scale => 10

With no result, any ideas what's going on?

From the console on the remote server I get the lat as being:

#<BigDecimal:2aebcc5967c0,'0.50519322E2',18(18)>

and my machine as:

#<BigDecimal:10232f7c8,'0.50519322E2',12(16)>

which is also odd, the second one because it shows up as 50.0519322 when I edit it through my view but when I do to_f via console it gives me 50.519322

Both server and local machine are postgres, storage as numeric.

A: 

what is the DB you are using and what the is datatype of the field?

josh
postgres for both server and local machine... numeric
holden