I am trying to convert the temperature from Fahrenheit to Celsius:
puts 'Convertir grados Fahrenheit a Celcius' STDOUT.flush x = gets.chomp aprox = (x * 100.0).round(2) / 100.0 resultado = (aprox-32)/1.8 puts resultado
I use the correct formula to convert Fahrenheit to Celcius:
Celsius = Fahrenheit - 32 / 1.8
However, when I run it in the console, it causes the following error:
`round ': wrong number of arguments (1 to 0) (ArgumentError)
I tried different things, but I donβt understand why this is not working.
ruby rounding
Ivanhercaz
source share