TickerScrape/items.py
def perc_str_to_float(perc_str):
    '''Convert a percentage string-formatted number into a float.'''
    if type(perc_str) is str:
        try:
            fl_num = float(perc_str.replace(',', '').replace('%', ''))
            fl = fl_num / 100
        except:
            fl = float("NaN")
    else:
        try:
            fl_num = float(perc_str)
            fl = fl_num / 100
        except:
            fl = float("NaN")
    return fl
Convert a percentage string-formatted number into a float.
Convert a percentage string-formatted number into a float.
Convert a percentage string - formatted number into a float .
def perc_str_to_float(perc_str):
    if type(perc_str) is str:
        try:
            fl_num = float(perc_str.replace(',', '').replace('%', ''))
            fl = fl_num / 100
        except:
            fl = float("NaN")
    else:
        try:
            fl_num = float(perc_str)
            fl = fl_num / 100
        except:
            fl = float("NaN")
    return fl
def perc_str_to_float ( perc_str ) : if type ( perc_str ) is str : try : fl_num = float ( perc_str . replace ( ',' , '' ) . replace ( '%' , '' ) ) fl = fl_num / 100 except : fl = float ( "NaN" ) else : try : fl_num = float ( perc_str ) fl = fl_num / 100 except : fl = float ( "NaN" ) return fl
Convert a percentage string-formatted number into a float.
Convert a percentage string - formatted number into a float .
'''Convert a percentage string-formatted number into a float.'''
perc_str