From: John Maclean Date: 2008-02-12T10:15:45+09:00 Subject: Re: Ruby one liner killed my script Where can I find out more about that method within ri? ri Object? On Tue, 12 Feb 2008 09:50:25 +0900 7stud -- wrote: > John Maclean wrote: > > I'm wondering > > how I can convert a user's input into a fixnum? > > > > def put_bin_string > > # this is the line in which I originally tried to convert > > # the user's binary digit to denary: > > > >puts "your bin #{@ustring.to_i} = > > 0b#{@ustring.to_i}" end > > end > > > > Does this help: > > input = "10000001" > puts input.to_i(base=2) > > --output:-- > 129 -- Regards, John Maclean MSc (DIC) +44 7739 171 531