2011-03-27 22:56:15 +02:00
|
|
|
module ApplicationHelper
|
2014-02-17 18:05:39 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2014-07-31 21:35:21 +02:00
|
|
|
# shortcut for capitalize
|
|
|
|
def T(symbol)
|
|
|
|
t(symbol).capitalize
|
|
|
|
end
|
|
|
|
|
|
|
|
# shortcut for titleize
|
|
|
|
def TT(symbol)
|
|
|
|
t(symbol).titleize
|
|
|
|
end
|
|
|
|
|
2011-03-27 22:56:15 +02:00
|
|
|
end
|
2014-02-17 18:05:39 +01:00
|
|
|
|