Author: Carl Friedrich Bolz-Tereick <cfb...@gmx.de> Branch: py3.6 Changeset: r98605:0115587c02f4 Date: 2020-01-30 14:45 +0100 http://bitbucket.org/pypy/pypy/changeset/0115587c02f4/
Log: merge default diff --git a/pypy/objspace/std/newformat.py b/pypy/objspace/std/newformat.py --- a/pypy/objspace/std/newformat.py +++ b/pypy/objspace/std/newformat.py @@ -802,7 +802,7 @@ digits = self._upcase_string(digits) out.append(digits) if spec.n_decimal: - out.append(self._lit(".")[0]) + out.append(self._lit(self._loc_dec)[0]) if spec.n_remainder: out.append(num[to_remainder:]) if spec.n_rpadding: diff --git a/pypy/objspace/std/test/test_newformat.py b/pypy/objspace/std/test/test_newformat.py --- a/pypy/objspace/std/test/test_newformat.py +++ b/pypy/objspace/std/test/test_newformat.py @@ -404,6 +404,24 @@ finally: locale.setlocale(locale.LC_NUMERIC, 'C') + def test_locale_german(self): + import locale + for name in ['de_DE', 'de_DE.utf8']: + try: + locale.setlocale(locale.LC_NUMERIC, name) + break + except locale.Error: + pass + else: + skip("no german locale") + x = 1234.567890 + try: + assert locale.format('%g', x, grouping=True) == '1.234,57' + assert format(x, 'n') == '1.234,57' + assert format(12345678901234, 'n') == '12.345.678.901.234' + finally: + locale.setlocale(locale.LC_NUMERIC, 'C') + def test_dont_switch_to_g(self): skip("must fix when float formatting is figured out") assert len(format(1.1234e90, "f")) == 98 _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit