# round-half-even

> A utility for tie-breaking rounding, also called Banker's Rounding or Commercial Rounding

Latest version **1.3.0** (published 2022-12-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install round-half-even
pnpm add round-half-even
yarn add round-half-even
bun add round-half-even
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2022-12-22 |
| First published | 2018-02-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Subir Chowdhuri |
| Maintainers | schowdhuri |

## Links

- npm: https://www.npmjs.com/package/round-half-even
- Repository: https://github.com/schowdhuri/round-half-even
- Homepage: https://github.com/schowdhuri/round-half-even#readme
- Issues: https://github.com/schowdhuri/round-half-even/issues
- npm.io page: https://npm.io/package/round-half-even

## Recent versions

- 1.3.0 (latest) — 2022-12-22
- 1.2.2 — 2021-10-18
- 1.2.1 — 2021-03-12
- 1.2.0 — 2021-03-11
- 1.1.0 — 2018-02-13
- 1.0.2 — 2018-02-13
- 1.0.1 — 2018-02-13
- 1.0.0 — 2018-02-13

## README

# Round Half to Even

A utility for tie-breaking rounding, also called Banker's Rounding or Commercial Rounding.

Read more: https://en.wikipedia.org/wiki/Rounding#Round_half_to_even

## Demo

https://rawgit.com/schowdhuri/round-half-even/master/demo/index.html

## Installation

Using npm:

```sh
npm install --save round-half-even
```

Or yarn:

```sh
yarn add round-half-even
```

## Usage

```js
roundHalfEven(floatingPointValue, numberOfDecimals);
```

### Node.js

```js
import roundHalfEven from "round-half-even";
roundHalfEven(1.435, 2); // returns 1.44
```

### Within the browser:

```html
<script src="https://unpkg.com/round-half-even"></script>
<script>
  roundHalfEven(1.435, 2); // returns 1.44
</script>
```

## Development

Make changes to `src/index.js`. Generate the browser-ready package:

```sh
npm run build
```

or

```sh
yarn build
```

Run tests:

```sh
npm test
```

or

```sh
yarn test
```

## [MIT Licensed](LICENSE)

---
_Source: https://npm.io/package/round-half-even · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
