fix number detection in feed fields

This commit is contained in:
Lee Lawlor 2014-12-29 14:11:21 -05:00
parent 4d27c5dfe6
commit 1052f35c98

View File

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