Re: beer

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

[email protected] 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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs