We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bbfcb38 commit 2753a09Copy full SHA for 2753a09
1 file changed
Lib/locale.py
@@ -303,12 +303,16 @@ def str(val):
303
304
def delocalize(string):
305
"Parses a string as a normalized number according to the locale settings."
306
+
307
+ conv = localeconv()
308
309
#First, get rid of the grouping
- ts = localeconv()['thousands_sep']
310
+ ts = conv['thousands_sep']
311
if ts:
312
string = string.replace(ts, '')
313
314
#next, replace the decimal point with a dot
- dd = localeconv()['decimal_point']
315
+ dd = conv['decimal_point']
316
if dd:
317
string = string.replace(dd, '.')
318
return string
0 commit comments