how to get a formatted string?

Gary Herron gherron at islandtraining.com
Tue Sep 4 03:55:16 EDT 2007


Ginger wrote:
> like format function in Visual Basic, 
> format("##.##%",0.3456) ==>>  34.56%
>   
"%5.2f%%" % (0.3456*100)
'34.56%'


See this section of the manual: 
http://docs.python.org/lib/typesseq-strings.html

Gary Herron




More information about the Python-list mailing list