gh-87790: support thousands separators for formatting fractional part of floats (#125304)

```pycon
>>> f"{123_456.123_456:_._f}"  # Whole and fractional
'123_456.123_456'
>>> f"{123_456.123_456:_f}"    # Integer component only
'123_456.123456'
>>> f"{123_456.123_456:._f}"   # Fractional component only
'123456.123_456'
>>> f"{123_456.123_456:.4_f}"  # with precision
'123456.1_235'
```
This commit is contained in:
Sergey B Kirpichev 2025-02-25 18:27:07 +03:00 committed by GitHub
parent fa6a8140dd
commit f39a07be47
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 218 additions and 45 deletions

View file

@ -246,7 +246,8 @@ extern Py_ssize_t _PyUnicode_InsertThousandsGrouping(
Py_ssize_t min_width,
const char *grouping,
PyObject *thousands_sep,
Py_UCS4 *maxchar);
Py_UCS4 *maxchar,
int forward);
/* --- Misc functions ----------------------------------------------------- */