From: Rajinder Yadav Date: 2010-10-20T22:47:28+09:00 Subject: Re: Comparison error On Wed, Oct 20, 2010 at 7:23 AM, Brian Candler wrote: > Rajinder Yadav wrote in post #955622: >> you can also do >> >> age = Integer(ageText) >> >> the 2nd form will throw an ArgumentError exception if ageText is not a >> number > > Beware that it also has some other behaviour you might not expect. > >>> Integer("20") > => 20 >>> Integer("00020") > => 16 >>> Integer("0x00020") > => 32 > > -- > Posted via http://www.ruby-forum.com/. > > nice thanks for pointing that out =) -- Kind Regards, Rajinder Yadav | http://DevMentor.org | Do Good! - Share Freely