Mercurial > cpython-lru_cache-weakref
diff Include/bytesobject.h @ 52773:28096ed73153
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).
| author | Eric Smith <eric@trueblade.com> |
|---|---|
| date | Fri, 03 Apr 2009 14:45:06 +0000 |
| parents | 548dccc4008e |
| children | b653eab13b73 |
line wrap: on
line diff
--- a/Include/bytesobject.h Fri Apr 03 11:19:31 2009 +0000 +++ b/Include/bytesobject.h Fri Apr 03 14:45:06 2009 +0000 @@ -91,13 +91,25 @@ into the string pointed to by buffer. For the argument descriptions, see Objects/stringlib/localeutil.h */ -PyAPI_FUNC(int) _PyBytes_InsertThousandsGrouping(char *buffer, +PyAPI_FUNC(int) _PyBytes_InsertThousandsGroupingLocale(char *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) _PyBytes_InsertThousandsGrouping(char *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); + /* Flags used by string formatting */ #define F_LJUST (1<<0) #define F_SIGN (1<<1)
