diff --git a/django/utils/formats.py b/django/utils/formats.py
index fc68179..6617142 100644
a
|
b
|
def sanitize_separators(value):
|
213 | 213 | parts.append(decimals) |
214 | 214 | if settings.USE_THOUSAND_SEPARATOR: |
215 | 215 | thousand_sep = get_format('THOUSAND_SEPARATOR') |
216 | | for replacement in set([ |
217 | | thousand_sep, unicodedata.normalize('NFKD', thousand_sep)]): |
218 | | value = value.replace(replacement, '') |
| 216 | if thousand_sep == '.' and value.count('.') == 1 and len(value.split('.')[-1]) != 3: |
| 217 | # Special case where we suspect a dot meant decimal separator (see #22171) |
| 218 | pass |
| 219 | else: |
| 220 | for replacement in set([ |
| 221 | thousand_sep, unicodedata.normalize('NFKD', thousand_sep)]): |
| 222 | value = value.replace(replacement, '') |
219 | 223 | parts.append(value) |
220 | 224 | value = '.'.join(reversed(parts)) |
221 | 225 | return value |
diff --git a/tests/i18n/tests.py b/tests/i18n/tests.py
index 1d34f90..3770aa4 100644
a
|
b
|
class FormattingTests(TestCase):
|
720 | 720 | with self.settings(USE_THOUSAND_SEPARATOR=True, USE_L10N=False): |
721 | 721 | self.assertEqual(sanitize_separators('12\xa0345'), '12\xa0345') |
722 | 722 | |
| 723 | with patch_formats(get_language(), THOUSAND_SEPARATOR='.', DECIMAL_SEPARATOR=','): |
| 724 | with self.settings(USE_THOUSAND_SEPARATOR=True): |
| 725 | self.assertEqual(sanitize_separators('10.234'), '10234') |
| 726 | # Suspicion that user entered dot as decimal separator (#22171) |
| 727 | self.assertEqual(sanitize_separators('10.10'), '10.10') |
| 728 | |
723 | 729 | def test_iter_format_modules(self): |
724 | 730 | """ |
725 | 731 | Tests the iter_format_modules function. |