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).
This commit is contained in:
Eric Smith 2009-04-03 14:45:06 +00:00
parent f8c8b6d3ea
commit a3b1ac8dca
10 changed files with 190 additions and 88 deletions

View file

@ -368,7 +368,7 @@ add_thousands_grouping(char* buffer, size_t buf_size)
/* At this point, p points just past the right-most character we
want to format. We need to add the grouping string for the
characters between buffer and p. */
return _PyBytes_InsertThousandsGrouping(buffer, len, p-buffer,
return _PyBytes_InsertThousandsGroupingLocale(buffer, len, p-buffer,
buf_size, NULL, 1);
}