def atof(string, func=float):
<EOL>ts = localeconv()['<STR_LIT>']<EOL>if ts:<EOL><INDENT>string = string.replace(ts, '<STR_LIT>')<EOL><DEDENT>dd = localeconv()['<STR_LIT>']<EOL>if dd:<EOL><INDENT>string = string.replace(dd, '<STR_LIT:.>')<EOL><DEDENT>return func(string)<EOL>
Parses a string as a float according to the locale settings.