def to_number(ns)
    if ns.include? '.'
        return ns.to_f
    else
        return ns.to_i
    end
end

def to_number(ns)
    if ns.class == String
        if ns.include? '.'
            return ns.to_f
        else
            return ns.to_i
        end
    else
        return ns
    end
end

Fix to_number to work with numbers.
Fix to_number to work with numbers.
