demarches-normaliennes/app/services/number_service.rb

5 lines
No EOL
101 B
Ruby

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