How to show percentage

George Sakkis gsakkis at rutgers.edu
Thu Sep 22 17:31:53 EDT 2005


"Sen-Lung Chen" <slchen at larc.ee.nthu.edu.tw> wrote:
> Dear All:
>  I have a question of show percentage.
> For example ,I want to show the percentage of 1/3 = 33.33%
>
>  I use the 1*100/3 = 33
> it is 33 not 33.33 , how to show the 33.33 %
>  Thanks

"%.2f%%" % (100./3.)

Not quite the most readable expression in python.. ;)

George





More information about the Python-list mailing list