Module: Convert
- Defined in:
- lib/F2C.rb
Class Method Summary collapse
- .C2F(value) ⇒ Object
-
.F2C(value) ⇒ Object
Convert.C2F(value) - “converts Celsius to Fahrenheit”.
Class Method Details
.C2F(value) ⇒ Object
18 19 20 21 |
# File 'lib/F2C.rb', line 18 def self.C2F value converted_value = ((value * 9.0/5.0) + 32).round return "#{value} Celsius is #{converted_value} Fahrenheit" end |
.F2C(value) ⇒ Object
Convert.C2F(value) - “converts Celsius to Fahrenheit”
13 14 15 16 |
# File 'lib/F2C.rb', line 13 def self.F2C value converted_value = ((value - 32) * 5.0/9.0).round return "#{value} Fahrenheit is #{converted_value} Celsius" end |