results of division

Paul Rubin http
Thu Dec 9 09:51:10 EST 2004


Brad Tilley <bradtilley at gmail.com> writes:
> What is the proper way to limit the results of division to only a few
> spaces after the decimal? I don't need rocket-science like
> precision. Here's an example:
> 
> 1.775 is as exact as I need to be and normally, 1.70 will do.

"%.2f"% 1.775



More information about the Python-list mailing list