demarches-normaliennes/app/services/number_service.rb

5 lines
103 B
Ruby

class NumberService
def self.to_number(string)
string.to_s if Float(string) rescue nil
end
end