> temp=gets.chomp
temp is still a string, as is all input read from stdin. Try replacing
that line with:
temp=gets.chomp.to_i

Dan

dwyer / o2.ie wrote:
> The following code leads to an error -
> 
> temp.rb:5:in `*': String can't be coerced into Fixnum (TypeError)
> 
> can someone explain the error to me so I can determine how to resolve it, Thanks a million!
> 
> def c_f(temp)
> 	convert=((9/5)*temp)+32
> 	print "the coverted fig is ", convert
> end
> temp=gets.chomp
> Integer(temp)
> c_f(temp)
> 
> 
> --
> --------------------------------- --- -- -
> Posted with NewsLeecher v3.9 Beta 1
> Web @ http://www.newsleecher.com/?usenet
> ------------------- ----- ---- -- -
> 
> 
>