From: Timothy Hunter Date: 2006-08-03T07:00:03+09:00 Subject: Re: Can't convert String into Integer (TypeError) ara.t.howard@noaa.gov wrote: > jib:~ > ruby -r RMagick -e' p > Magick::Image.instance_methods.grep(/raise/) ' > ["raise"] > > > 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 > > cheers. > > -a Arg! I should spend more time coding in Ruby and less in C. Thanks, Ara! "1%0%".delete('%') => "10". Might be a bit too tolerent, don't you think? I had the clamping down to 1 line but when I looked at it the next day I couldn't tell if it was correct or not :-(