From: Tobias Reif Date: 2002-01-13T02:43:02+09:00 Subject: Re: I/O gets and integers Mathieu Bouchard wrote: > If you want to accept both Integers and Floats, you can do > this: (temp=gets; Integer(temp) rescue Float(temp)) > so if you want you can append .to_f to that to make > sure every result is a Float even when it was written as an Integer. In this case, perhaps simply out = Float(str) rescue str ? (without Integer() and .to_f) Tobi -- http://www.pinkjuice.com/