# round « integer « Python Data Type Q&A

Home
Python Data Type Q&A
 1 array 2 date 3 dictionary 4 Format 5 integer 6 List 7 numpy 8 regex 9 string 10 tuple
 Python Data Type Q&A » integer » round

### 1. How do you round UP a number in Python?    stackoverflow.com

This problem is killing me. How does one roundup a number UP in Python? I tried round(number) but it round the number down. Example:

``round(2.3) = 2.0 and not 3, what I would ...``

### 2. How to round integers in python    stackoverflow.com

I am trying to round integers in python. I looked at the built-in round() function but it seems that that rounds floats. My goal is to round integers to the closest ...

### 3. python round problem    stackoverflow.com

I am facing the problem while dividing

``````my max_sum = 14
total_no=4
``````
so when i do
``````print "x :", (total_sum/total_no)
``````
, I get 3 and not 3.5 I tried many ways for ...

### 4. Round with integer division    stackoverflow.com

Is there is a simple, pythonic way of rounding to the nearest whole number without using floating point? I'd like to do the following but with integer arithmetic:

``skip = int(round(1.0 ...``

### 5. Python module for ganglia - precision number being rounded by gmond    stackoverflow.com

I've written a python module for ganglia that is returning response times. The raw times look like this: 0.0120489597321 I parse this with my python module and return the time as such:

``return ...``

### 8. Rounding floats to integers    python-forum.org

Okay, basically I have a list of integers. I made a second list of those same integers, and divide it by a number. Now when I go back and multiply the second list by that number again, it isn't "exactly equal" to the first list. So if I have list 1 = [1.0, 2.0, 3.0, 4.0, 5.0] and list 2 * ...