A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/322790.html below:

How to show percentage

How to show percentage How to show percentageBill Mill bill.mill at gmail.com
Thu Sep 22 14:31:55 EDT 2005
You need to convert 1 or 3 to a float. How about:

>>> def pct(num, den): return (float(num)/den) * 100
...
>>> pct(1, 3)
33.333333333333329

Peace
Bill Mill
bill.mill at gmail.com

On 22 Sep 2005 10:51:43 -0700, Sen-Lung Chen
<slchen at slugger.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
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4