mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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:
parent
fa6a8140dd
commit
f39a07be47
9 changed files with 218 additions and 45 deletions
|
@ -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 ----------------------------------------------------- */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue