This one has had me chasing my tail for the past hour… and I finally found a reproducible example:

$ irb1.8
irb(main):074:0> amt = "1298.34"
=> "1298.34"
irb(main):075:0> amt.to_f
=> 1298.34
irb(main):076:0> (amt.to_f * 100).to_i
=> 129833
irb(main):077:0> (amt.to_f * 100)
=> 129834.0
irb(main):078:0> amtf = (amt.to_f * 100)
=> 129834.0
irb(main):079:0> amtf.to_i
=> 129833
irb(main):080:0> amt2 = 129834.0
=> 129834.0
irb(main):081:0> amt2
=> 129834.0
irb(main):082:0> amt2.to_i
=> 129834

In general, I realize that Float arithmetic is different than what I’d expect it to be, but that’s a little ridiculous.

¥