rowland / fb

Firebird Extension Library for Ruby
64 stars 35 forks source link

numeric(15, 4) column type returns wrong value #1

Closed johnleroux closed 14 years ago

johnleroux commented 15 years ago

Having a column declared numeric(15, 4) the correct values are inserted into the database, but select the column return incorrect value. E.g. if I insert 100 then that is what is stored in the database, but when selecting it fb returns 1000000

Firebird 2.0.4 OS: Suse 11.1

mariuz commented 15 years ago

seems that you are not the only one with numeric issues http://mapopa.blogspot.com/2009/02/fireruby-howto-start-with-firebird-and.html?showComment=1242471780000#c3009864347908989931

johnleroux commented 15 years ago

Yes, but the rails adapter is not the problem. It is the fb library. If have tried to see if I can find the problem but I could'nt. So I am using the fireruby library at the momernt.

rowland commented 14 years ago

Fixed in 0.5.10.

mariuz commented 14 years ago

Thanks added the fix and news about new releases on the firebirdnews.org :) also response to the blog

rowland commented 14 years ago

Numeric types requiring the INT64 storage type were not being scaled properly.

Warning: Although database storage is fixed-point, Ruby is using doubles, with all the inherent imprecision those imply.

johnleroux commented 14 years ago

Thank you very much for this fix.