# wrRound

> Rounds a number to a fixed number of decimals. Corrects float drift (`1.005` to `1.01`) only for values under 2.

Source: https://ngwr.dev/reference/utils/wr-round  
Kind: Util  
Updated in v16  
Optional

## Usage

```angular-ts
import { wrRound } from 'ngwr/utils';

wrRound(0.1 + 0.2, 2); // 0.3
wrRound(1.005, 2);     // 1.01
wrRound(7.4);          // 7
```

## API

| Name | Description | Type | Default |
| --- | --- | --- | --- |
| `wrRound` | Rounds `value` to `decimals` fraction digits. | `(value: number, decimals = 0) => number` | `—` |

## See also

- [wrClamp](https://ngwr.dev/reference/utils/wr-clamp) — Clamps a number into an inclusive [min, max] range.
- [wrDecimal](https://ngwr.dev/reference/utils/wr-decimal) — Exact decimal arithmetic on strings, with no float on the way.
- [wrNumber](https://ngwr.dev/reference/pipes/wr-number) — Format a number, percent or price in the app locale.
- [Number Input](https://ngwr.dev/reference/components/input-number) — A number field with stepper buttons and locale formatting.
