Class: Numeric

Inherits:
Object
  • Object
show all
Defined in:
lib/feature/GoogleWeather.rb

Instance Method Summary collapse

Instance Method Details

#c2fObject



97
98
99
# File 'lib/feature/GoogleWeather.rb', line 97

def c2f
  self.to_f*9.0/5+32
end

#f2cObject



92
93
94
95
# File 'lib/feature/GoogleWeather.rb', line 92

def f2c
  # 华氏℉(Fahrenheit)=℃×9/5+32.摄氏℃(Celsius or Centigrade)=5/9×(℉-32)
  5.0/9*(self.to_f-32)
end