def format_float ( value ) : # not used string = "{:g}" . format ( value ) . replace ( "e+" , "e" ) string = re . sub ( "e(-?)0*(\d+)" , r"e\1\2" , string ) return string
python string % substitution float
Modified form of the g format specifier .
def format_float(value): # not used
    """Modified form of the 'g' format specifier.
    """
    string = "{:g}".format(value).replace("e+", "e")
    string = re.sub("e(-?)0*(\d+)", r"e\1\2", string)
    return string