diff options
author | doko <doko@ubuntu.com> | 2017-01-31 13:35:26 +0100 |
---|---|---|
committer | doko <doko@ubuntu.com> | 2017-01-31 13:35:26 +0100 |
commit | e0cb38ac4330d5e09b5e21c74c5d5e453af99a4f (patch) | |
tree | a64fe56edb37bb84d4ffea1990c0ac124a6dba9d /Lib/locale.py | |
parent | d7764ed2a9255ddb5bdb7d3f184610cdc7a66aad (diff) | |
parent | 602663ac0effc2e8e3b615141babd95ed7691dda (diff) | |
download | cpython-e0cb38ac4330d5e09b5e21c74c5d5e453af99a4f.tar.gz |
merge 3.5
Diffstat (limited to 'Lib/locale.py')
-rw-r--r-- | Lib/locale.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/locale.py b/Lib/locale.py index 6d59cd8bab..4de0090ed9 100644 --- a/Lib/locale.py +++ b/Lib/locale.py @@ -302,12 +302,16 @@ def str(val): def delocalize(string): "Parses a string as a normalized number according to the locale settings." + + conv = localeconv() + #First, get rid of the grouping - ts = localeconv()['thousands_sep'] + ts = conv['thousands_sep'] if ts: string = string.replace(ts, '') + #next, replace the decimal point with a dot - dd = localeconv()['decimal_point'] + dd = conv['decimal_point'] if dd: string = string.replace(dd, '.') return string |