1.2.0 • Published 1 year ago

saferound v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

saferound

npm npm bundle size (version) npm GitHub test Coverage Status

About

saferound is a simplified typescript adaption of the python library Iteround, a sum-safe rounding library.

The library solves the problem of rounding a list of numbers whilst preserving the sum.

Usage

import saferound from 'saferound';

const result = safeRound([4.0001, 3.2345, 3.2321, 6.4523, 5.3453, 7.3422], 0); // sum = 30
expect(result).toEqual([5, 3, 4, 6, 5, 7]); // sum = 30

License

Distributed under the MIT License. See LICENSE for more information.

1.2.0

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1-0

2 years ago