@writetome51/get-rounded-up-down
v3.0.1
Published
3 functions: getRounded(), getRoundedUp(), getRoundedDown()
Downloads
22
Maintainers
Readme
getRounded(num): number
Avoids cumulative rounding errors only by changing rounding rules when
the fraction part of num
is .5
:
getRoundedDown(num): number
Behaves same as Math.floor()
.
getRoundedUp(num): number
Behaves same as Math.ceil()
.
For all 3 functions, num
must be a finite number of type 'number'.
Installation
npm i @writetome51/get-rounded-up-down
Loading
import { getRounded, getRoundedDown, getRoundedUp }
from '@writetome51/get-rounded-up-down';