From: "F. Senault" Date: 2006-08-03T07:55:10+09:00 Subject: Re: Can't convert String into Integer (TypeError) Le 2 ao�t 2006 � 23:38, ara.t.howard@noaa.gov a �crit : > btw, seems like you could get away with something like: > > pct = Float(pct) rescue (Float(pct.to_s.delete('%'))/100) > r = 0.0 .. 1.0 > pct = [r.min, pct].max > pct = [r.max, pct].min BTW, another fun way to write the three last lines would be : [0.0, pct, 1.0].sort[1] But it doesn't convey the meaning well... :) Fred -- I bought me an illusion An' I put it on the wall I left it fill my head with dreams And I had to have them all But oh the taste is never so sweet As what you'b believe it is... Well I guess it never is (Guns n' Roses, Locomotive)