(string, func=float)
return func(string)
Parses a string as a float according to the locale settings.
Parses a string as a float according to the locale settings.
Parses a string as a float according to the locale settings .
def atof(string, func=float):
    "Parses a string as a float according to the locale settings."
    #First, get rid of the grouping
    ts = localeconv()['thousands_sep']
    if ts:
        string = string.replace(ts, '')
    #next, replace the decimal point with a dot
    dd = localeconv()['decimal_point']
    if dd:
        string = string.replace(dd, '.')
    #finally, parse the string
    return func(string)
def atof ( string , func = float ) : #First, get rid of the grouping ts = localeconv ( ) [ 'thousands_sep' ] if ts : string = string . replace ( ts , '' ) #next, replace the decimal point with a dot dd = localeconv ( ) [ 'decimal_point' ] if dd : string = string . replace ( dd , '.' ) #finally, parse the string return func ( string )