lib/interage/number_helper.rb in interage-helper-0.1.3 vs lib/interage/number_helper.rb in interage-helper-0.1.4
- old
+ new
@@ -3,7 +3,11 @@
module Interage
module NumberHelper
def default_currency_format(number, precision = 2, unit = 'R$')
number_to_currency(number, precision: precision, unit: unit)
end
+
+ def only_numbers(number)
+ number.to_s.gsub(/[^0-9]/, '')
+ end
end
end