I have been facing some problem with the datatypes. I have a sample of

code

as follows.

t.lat_rad = (l.lat * BigDecimal.new(“3.1415926536 / 180”)).to_f

t.lng_rad = (l.lng * BigDecimal.new(“3.1415926536 / 180”)).to_f

Initially, the datatype of lat_rad and lng_rad was as follows:

t.decimal :lat_rad, :precision => 15, :scale => 10

t.decimal :lng_rad, :precision => 15, :scale => 10

So, it gave me an error as follows:

TypeError in ItemsController#populate

wrong argument type BigDecimal (expected Float)

Then I changed the data type of lat_rad and lng_rad to float. Even then

it

is giving me the same error. Any help to solve this problem will be

appreciated. Thanks in advance.

–

View this message in context:

http://old.nabble.com/datatype-error-in-ROR-tp27808361p27808361.html

Sent from the RubyOnRails Users mailing list archive at Nabble.com.