diff options
author | Eric Smith <eric@trueblade.com> | 2009-04-03 14:45:06 (GMT) |
---|---|---|
committer | Eric Smith <eric@trueblade.com> | 2009-04-03 14:45:06 (GMT) |
commit | a3b1ac8dca5afa01d9d542e125052014a9af56eb (patch) | |
tree | b48929a3d3460d116182f81e7fb80dab5548211f /Include/unicodeobject.h | |
parent | f8c8b6d3ea995d9ddce9470fe6fd2a9c956a5d5d (diff) | |
download | cpython-a3b1ac8dca5afa01d9d542e125052014a9af56eb.zip cpython-a3b1ac8dca5afa01d9d542e125052014a9af56eb.tar.gz cpython-a3b1ac8dca5afa01d9d542e125052014a9af56eb.tar.bz2 |
Added ',' thousands grouping to int.__format__. See PEP 378.
This is incomplete, but I want to get some version into the next alpha. I am still working on:
Documentation.
More tests.
Implement for floats.
In addition, there's an existing bug with 'n' formatting that carries forward to thousands grouping (issue 5515).
Diffstat (limited to 'Include/unicodeobject.h')
-rw-r--r-- | Include/unicodeobject.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index 8259743..98c0372 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -1482,13 +1482,24 @@ PyAPI_FUNC(PyObject *) _PyUnicode_XStrip( into the string pointed to by buffer. For the argument descriptions, see Objects/stringlib/localeutil.h */ -PyAPI_FUNC(int) _PyUnicode_InsertThousandsGrouping(Py_UNICODE *buffer, +PyAPI_FUNC(int) _PyUnicode_InsertThousandsGroupingLocale(Py_UNICODE *buffer, Py_ssize_t n_buffer, Py_ssize_t n_digits, Py_ssize_t buf_size, Py_ssize_t *count, int append_zero_char); +/* Using explicit passed-in values, insert the thousands grouping + into the string pointed to by buffer. For the argument descriptions, + see Objects/stringlib/localeutil.h */ +PyAPI_FUNC(int) _PyUnicode_InsertThousandsGrouping(Py_UNICODE *buffer, + Py_ssize_t n_buffer, + Py_ssize_t n_digits, + Py_ssize_t buf_size, + Py_ssize_t *count, + int append_zero_char, + const char *grouping, + const char *thousands_sep); /* === Characters Type APIs =============================================== */ /* Helper array used by Py_UNICODE_ISSPACE(). */ |