module Convert

Public Class Methods

C2F(value) click to toggle source
# 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) click to toggle source

Overveiw F2C converts Fahrenheit to Celsius and vice versa Fahrenheit to Celsius formulas www.manuelsweb.com/temp.htm

How to use it gem install F2C launch irb require ‘F2C’ Convert.F2C(value) - “converts Fahrenheit to Celsius” Convert.C2F(value) - “converts Celsius to Fahrenheit”

# 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