I wonder if this would work... I'm at work with no ruby :(
def favorite_number
puts "what is your favorite number?"
puts "this is a better number #{gets.chomp.to_i + 1 }"
end
On 5/12/06, Guest <pat.eyler / gmail.com> wrote:
> Guest wrote:
> > corey konrad wrote:
> >> what is going on here, i dont understand why i keep getting conversion
> >> errors. i am making a conversion from a string to and integer i dont
> >> understand why it isnt working.
> >
> > because it needs to be a string when you print it.
> (well, actually when you concatenate prior to printing)
>
>
> >> irb(main):041:1> puts "this is a better number" + i_num
> >
> > puts "this is a better number" + i_num.to_s
>
> --
> Posted via http://www.ruby-forum.com/.
>
>