diff options
author | Sergey B Kirpichev <skirpichev@gmail.com> | 2025-02-25 15:27:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-25 15:27:07 (GMT) |
commit | f39a07be47cd9219eaf0e538ae32ad8239c88e66 (patch) | |
tree | 1b57568378401b44c9ffd8d3f237b13694842b5c /Include/internal/pycore_unicodeobject.h | |
parent | fa6a8140dd2a72da6df2a7dfafbf07045debf64d (diff) | |
download | cpython-f39a07be47cd9219eaf0e538ae32ad8239c88e66.zip cpython-f39a07be47cd9219eaf0e538ae32ad8239c88e66.tar.gz cpython-f39a07be47cd9219eaf0e538ae32ad8239c88e66.tar.bz2 |
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'
```
Diffstat (limited to 'Include/internal/pycore_unicodeobject.h')
-rw-r--r-- | Include/internal/pycore_unicodeobject.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Include/internal/pycore_unicodeobject.h b/Include/internal/pycore_unicodeobject.h index a60372f..13c3213 100644 --- a/Include/internal/pycore_unicodeobject.h +++ b/Include/internal/pycore_unicodeobject.h @@ -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 ----------------------------------------------------- */ |