Python\'s math module contain handy functions like floor & ceil. These functions take a floating point number and return the nearest integer be
floor
ceil
You could use the round function. If you use no second parameter (# of significant digits) then I think you will get the behavior you want.
IDLE output.
>>> round(2.99999999999) 3 >>> round(2.6) 3 >>> round(2.5) 3 >>> round(2.4) 2