[newbie] decimal precision

Neil Conway neilconway at home.com
Mon Sep 6 17:31:04 EDT 1999


Hello all.

I was wondering if anyone knows how to limit decimal precision in
Python. Here is an example of where my problem occurs:

>>> 3.0 / 7
0.428571428571

Lets say I wanted to limit the value it returns to 3 decimal places, for
example. How would that be done?

Thanks in advance,

Neil Conway




More information about the Python-list mailing list