def atof(string, func=float):
 ts = localeconv()['thousands_sep']
 if ts:
  string = string.replace(ts, '')
 dd = localeconv()['decimal_point']
 if dd:
  string = string.replace(dd, '.')
 return func(string)

def atof ( string , func = float ) : ts = localeconv ( ) [ 'thousands_sep' ] if ts : string = string . replace ( ts , '' ) dd = localeconv ( ) [ 'decimal_point' ] if dd : string = string . replace ( dd , '.' ) return func ( string )
convert the string s to a float .