Strip dollar signs and commas from financial numerical string

    Also, convert percentages to fractions/factors (generally between 0 and 1.0)

    >>> [financial_float(x) for x in ("12k Flat", "12,000 flat", "20%", "$10,000 Flat", "15K flat", "null", "None", "", None)]
    [12000.0, 12000.0, 0.2, 10000.0, 15000.0, 'null', 'none', '', None]

def financial_float(s, scale_factor=1, typ=float,
                    ignore=FINANCIAL_WHITESPACE,
                    percent_str=PERCENT_SYMBOLS,
                    replace=FINANCIAL_MAPPING,
                    normalize_case=str.lower):
    """Strip dollar signs and commas from financial numerical string

    Also, convert percentages to fractions/factors (generally between 0 and 1.0)

    >>> [financial_float(x) for x in ("12k Flat", "12,000 flat", "20%", "$10,000 Flat", "15K flat", "null", "None", "", None)]
    [12000.0, 12000.0, 0.2, 10000.0, 15000.0, 'null', 'none', '', None]
    """
    percent_scale_factor = 1
    if isinstance(s, basestring):
        s = normalize_case(s).strip()
        for i in ignore:
            s = s.replace(normalize_case(i), '')
        s = s.strip()
        for old, new in replace:
            s = s.replace(old, new)
        for p in percent_str:
            if s.endswith(p):
                # %% will become 0.0001
                percent_scale_factor *= 0.01
                s = s[:-len(p)]
    try:
        return (scale_factor if scale_factor < 1 else percent_scale_factor) * typ(float(s))
    except (ValueError, TypeError):
        return s