[Tutor] string formatting problem

Alan Gauld alan.gauld@blueyonder.co.uk
Sun Aug 3 13:06:10 EDT 2003


>  print  "%s  PN  %s   %s   %0.2f" % (a, x, z[2], a*b) 
> 
> It prints like this.
>                 
> 88   PN   1118   0.21 
>    18.48

Works ok for me, are you sure you don't accidentally have a 
number in front of the 0 in 0.2f? When I made it %60.2f I got 
the same pattern you get...

Alan G.




More information about the Tutor mailing list