Curious Omission In New-Style Formats

Lawrence D’Oliveiro lawrencedo99 at gmail.com
Sun Jul 10 20:34:27 EDT 2016


On Sunday, July 10, 2016 at 7:22:42 PM UTC+12, Ian wrote:
> On Sat, Jul 9, 2016 at 11:54 PM, Lawrence D’Oliveiro wrote:
>> In printf-style formats, you can specify the number of digits for an
>> integer separately from the field width. E.g.
>>
>>     >>> "%#0.5x" % 0x123
>>     '0x00123'
>>
> except perhaps that precision doesn't really make sense for integers
> in the first place.

Except that it does make sense, as I showed in my example.

<http://man7.org/linux/man-pages/man3/printf.3.html>



More information about the Python-list mailing list