---
title: "round"
space: "Student Handbook"
url: "https://portal.cs17.org/student-handbook/python-manual/built-in-functions/round"
updated: "2026-10-05"
---

Rounds a number.

## Synopsis

```python
round(number)
round(number, digits)
```

## Description

Without `digits`, `round` returns the nearest whole number. With `digits`, it keeps that many places after the decimal point.

An exact half rounds to the nearest **even** number: `round(2.5)` is `2`, but `round(3.5)` is `4`.

## Parameters

| Name | Meaning |
| --- | --- |
| `number` | The number to round. |
| `digits` | How many places to keep after the decimal point. Optional. |

## Return value

An `int` without `digits`, a `float` with it.

## Example

```python
print(round(3.7))
print(round(3.14159, 2))
print(round(2.5))
print(round(3.5))
```

It prints:

```text
4
3.14
2
4
```

## Common mistake

```python
print(round(2.675, 2))
```

It prints:

```text
2.67
```

You might expect `2.68`. The float stored for 2.675 is a little less than 2.675, so it rounds down. To show money, format it instead: `f"{x:.2f}"`.

## See also

[int](/student-handbook/python-manual/built-in-functions/int), [math.floor](/student-handbook/python-manual/math/floor), [math.ceil](/student-handbook/python-manual/math/ceil), [f-strings](/student-handbook/python-manual/strings/f-strings)

[round in the Python documentation](https://docs.python.org/3/library/functions.html#round)
