[Tutor] precision?

Chris Fuller cfuller084 at thinkingplanet.net
Tue Aug 9 17:44:27 CEST 2011


There's the one that comes with Python: 
http://docs.python.org/library/functions.html#round

You should consider working with integers, though.  Multiply all the values by 
1000 and drop the fractional part.

Cheers

On Tuesday 09 August 2011, Shwinn Ricci wrote:
> When comparing a given value with a database of values, but allowing for
> freedom due to variation at say, the thousandth digit, how does one
> generalize the precision to this degree? I don't want to truncate, so is
> there a round() function that takes into account what decimal place the
> value (database value) needs to be rounded to?



More information about the Tutor mailing list