thingspeak/app/helpers/application_helper.rb
2014-02-17 12:05:39 -05:00

13 lines
214 B
Ruby

module ApplicationHelper
def is_a_number?(s)
s.to_s.gsub(/,/, '.').match(/\A[+-]?\d+?(\.\d+)?\Z/) == nil ? false : true
end
def parsefloat(number)
return number.to_s.gsub(/,/, '.').to_f
end
end