Float(string) is your best bet. Why is this inadequate? Are you trying to
decide if a string "looks like a number" but don't want to work with it as
a number after that?


On Thu, Dec 27, 2012 at 10:40 AM, Brandon Weaver <keystonelemur / gmail.com>wrote:

> I've found a bit of an annoyance trying to find out if a number is numeric
> or not. I thought it would probably be a simple string method but I found
> far more contrived solutions like regex matches. Eventually I settled on
> monkey patching string with a Numeric? method using Float(self)! = nil
> rescue false.
>
> Is there a better way to go about this? If not, can we get something added
> to the core?
>
> Thanks for your time,
>
> Brandon
>



-- 
Tony Arcieri