diff --git a/django/utils/formats.py b/django/utils/formats.py
index e283490..7bbbcd3 100644
a
|
b
|
|
1 | 1 | import decimal |
2 | 2 | import datetime |
| 3 | import re |
3 | 4 | |
4 | 5 | from django.conf import settings |
5 | 6 | from django.utils import dateformat, numberformat, datetime_safe |
… |
… |
def sanitize_separators(value):
|
183 | 184 | value, decimals = value.split(decimal_separator, 1) |
184 | 185 | parts.append(decimals) |
185 | 186 | if settings.USE_THOUSAND_SEPARATOR: |
186 | | parts.append(value.replace(get_format('THOUSAND_SEPARATOR'), '')) |
| 187 | parts.append(re.sub(r'[%s]([0-9]{3})' % get_format('THOUSAND_SEPARATOR'), r'\1', value)) |
187 | 188 | else: |
188 | 189 | parts.append(value) |
189 | 190 | value = '.'.join(reversed(parts)) |