Undocumented alternate form for %#f ?

Dino Viehland dinov at exchange.microsoft.com
Fri Apr 28 14:20:42 EDT 2006


I'm assuming this is by-design, but it doesn't appear to be documented:

>>> '%8.f' % (-1)
'      -1'
>>> '%#8.f' % (-1)
'     -1.'


The docs list the alternate forms, but there isn't one listed for f/F.   It would seem the alternate form for floating points is truncate & round the floating point value, but always display the . at the end.  Is that correct?



Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038)




More information about the Python-list mailing list