Method: StringNumericHelper#get_float
- Defined in:
- lib/rubyhelper/string_numeric.rb
#get_float(sign = true) ⇒ String
get every digits and + - . , symbols in the string you can also see #to_fi to turn the String into a Float see als #get_1float #get_floats and #get_int
98 99 100 101 102 |
# File 'lib/rubyhelper/string_numeric.rb', line 98 def get_float(sign = true) return self.gsub(/[^\-\+\d\.\,]/, '') if sign == true return self.gsub(/[^\-\d\.\,]/, '') if sign == :less return self.gsub(/[^\d\.\,]/, '') end |