On Fri, Nov 7, 2008 at 9:12 PM, Greg Hauptmann <[EMAIL PROTECTED]> wrote: > yep - this was recommended on forums over float - why?
You are in for a lot of headaches in you application resorting to decimal fields in the database, since it restores them as BigDecimals. It sucks to deal with BigDecimals in your app. I very highly recommend the Money library. I recommend installing it as a plugin and using the CollectiveIdea fork. http://github.com/collectiveidea/money/tree/master Even if all you do is take 20 minutes to check out the Money library in a dummy app, I think you will be glad you did. Zach > > On Sat, Nov 8, 2008 at 11:48 AM, Zach Dennis <[EMAIL PROTECTED]> wrote: >> On Fri, Nov 7, 2008 at 6:24 PM, Greg Hauptmann >> <[EMAIL PROTECTED]> wrote: >>> (woops - full email below) >>> >>> Hi, >>> >>> My rails migrations / mysql database uses Decimal and I've noticed in >>> my rspec when I do a "...should eql(5.5)" that they're failing as the >>> expected result here is a float not a decimal. For example see >>> extract below: >>> >>> expected 6.5, got #<BigDecimal:23d8284,'0.65E1',8(8)> (using .eql?) >>> >>> What's the best way of addressing this? Is there trick regarding the >>> easiest way to address this? >> >> You aren't by chance using decimals to represent money are you? >> >> -- >> Zach Dennis >> http://www.continuousthinking.com >> http://www.mutuallyhuman.com >> _______________________________________________ >> rspec-users mailing list >> rspec-users@rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> > -- Zach Dennis http://www.continuousthinking.com http://www.mutuallyhuman.com _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users