# decimal.round · Rell standard library · Chromia Docs (concept)

> pure function round(): decimal Round this decimal to the nearest whole number. Examples: (-0.4).round() returns 0 (0.4).round() returns 0 (1.49999999999999

Source: https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/decimal/round/

FUNCTION

# decimal.round

```signature
pure function round(): decimal
```

Round this decimal to the nearest whole number.

Examples:

* `(-0.4).round()` returns `0`
* `(0.4).round()` returns `0`
* `(1.49999999999999999999).round()` returns `1`
* `(1.5).round()` returns `2`

Since 0.9.1

---

```signature
pure function round(digits: integer): decimal
```

Round this decimal to a specific number of decimal places.

`decimal.round(0)` is equivalent to `decimal.round()`, i.e. rounding will be to the nearest whole
number. Positive arguments round to an increasing number of decimal places, e.g. `1` rounds to the
neartest tenth, `2` to the nearest hundredth, `3` to the nearest thousandth. Negative arguments
round in the opposite way, i.e. `-1` rounds to the nearest ten, `-2` to the nearest hundred, `-3` to
the nearest thousand.

Examples:

* `(123.456).round(0)` returns `123`
* `(123.456).round(-1)` returns `120`
* `(123.456).round(1)` returns `123.4`
* `(123.456).round(-2)` returns `100`
* `(123.456).round(2)` returns `123.45`
* `(123.456).round(-3)` returns `0`
* `(123.456).round(3)` returns `123.456`

**Parameters**

* **digits** — the number of decimal places to round

Since 0.9.1

[View this page on docs.chromia.com](https://docs.chromia.com/pages/rell-stdlib/-rell%20-system%20-library/%5Broot%5D/decimal/round.html)Generated API reference, mirrored from the live docs
