lib/eucalypt/helpers/numeric.rb in eucalypt-0.6.2 vs lib/eucalypt/helpers/numeric.rb in eucalypt-0.7.0

- old
+ new

@@ -1,10 +1,10 @@ module Eucalypt module Helpers module Numeric def self.string?(string) - return true if string =~ /\A\d+\Z/ - true if Float(string) rescue false + return true if /\A\d+\Z/.match? string.to_s + true if Float(string.to_s) rescue false end end end end \ No newline at end of file