fix number detection in feed fields
This commit is contained in:
1 parent
4d27c5dfe6
commit
1052f35c98
1 file changed
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
|
|
||||||
def is_a_number?(s)
|
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
|
end
|
||||||
|
|
||||||
def parsefloat(number)
|
def parsefloat(number)
|
||||||
|
|||||||
Reference in new issue
Block a user