Forum: Ruby on Rails Re: beer

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Sean C. (Guest)
on 2006-03-29 23:22
(Received via mailing list)
to_f will convert it to a Float, .to_i to an Integer, but these won't
"tell" you whether it's numerical, in fact they often accept strings
that have some digits in them but also other characters.

The better solution might be to use a regular expression, the content of
which will be entirely dependent on what type of number you are

Sean C.
Web Services - KCKCC
>>> removed_email_address@domain.invalid 3/29/2006 12:41 PM >>>

Hello, all

I have one string in my controller but i need to knwon how i verify if
it is numerical

This topic is locked and can not be replied to.