def to_string(value, format='%i'):
    """returns a number as string

    If not a number, return empty string."""
    try:
        return format % value
    except TypeError:
        return ''
    except ValueError:
        return 'nan'
