This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.smith
Recipients eric.smith, mark, mark.dickinson
Date 2008-05-09.14:42:19
SpamBayes Score 0.052092757
Marked as misclassified No
Message-id <1210344141.48.0.781747387278.issue2802@psf.upfronthosting.co.za>
In-reply-to
Content
The reason for this is that 'n' is defined in PEP 3101 as being a float
format only, and the rule is that if an integer sees a float format, it
does a float conversion and then prints the float with the supplied format.

I'd be okay with adding 'n' as an integer format, with the loose
definition of "just like 'd', but adding thousands separators".

As to the implementation, the OS supplied float formatting does not add
thousands separators.  I added the function add_thousands_grouping() to
Python/pystrtod.c in order implement this for floats.  It would be easy
to make this same code work for integers (and in fact it might already
work, although there are probably memory allocation issues to deal with).

Maybe we should bring up modifying the PEP on python-dev or python-3000.

This issue exists in 2.6 as well.
History
Date User Action Args
2008-05-09 14:42:21eric.smithsetspambayes_score: 0.0520928 -> 0.052092757
recipients: + eric.smith, mark.dickinson, mark
2008-05-09 14:42:21eric.smithsetspambayes_score: 0.0520928 -> 0.0520928
messageid: <1210344141.48.0.781747387278.issue2802@psf.upfronthosting.co.za>
2008-05-09 14:42:20eric.smithlinkissue2802 messages
2008-05-09 14:42:19eric.smithcreate