defining precision in python(2.6) division
Question: 
    from __future__ import division
    

To perform a division in which I need some percision. However, it gives a long
number, like:

    
    
    1.876543820098765
    

I only need the the first two numbers after "." => 1.87 How can I do that?


Answer: 
    "%0.2f" % yournumber
    

As you said you don't want a rounded number, you might want to try

    
    
    def twoDigits(x):
        return int(100*x)/100.0
    

