From: Robert Klemme Date: 2011-12-17T04:55:17+09:00 Subject: Re: round float to integer if whole number On Fri, Dec 16, 2011 at 7:48 PM, Ronnie Aa wrote: > Converting to a string was also one of my ideas. Although it was not > completely clear to me how to achieve that. > > So thanx for your input.. > > Only drawback of this method is it's lack of elegance I think... Yeah. I'd go with a proximity check like def whole? x (x - x.floor) < 1e-6 end Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/