def lon2txt(lon, fmt='%g'):
    """
    Format the longitude number with degrees.

    :param lon: longitude
    :param fmt:
    :return:

    :Examples:
    >>> lon2txt(135)
     '135\N{DEGREE SIGN}E'
    >>> lon2txt(-30)
     '30\N{DEGREE SIGN}W'
    >>> lon2txt(250)
     '110\N{DEGREE SIGN}W'
    """
    lon = (lon + 360) % 360
    if lon > 180:
        lonlabstr = u'%s\N{DEGREE SIGN}W' % fmt
        lonlab = lonlabstr % abs(lon - 360)
    elif lon < 180 and lon != 0:
        lonlabstr = u'%s\N{DEGREE SIGN}E' % fmt
        lonlab = lonlabstr % lon
    else:
        lonlabstr = u'%s\N{DEGREE SIGN}' % fmt
        lonlab = lonlabstr % lon
    return lonlab