3.0.1 • Published 4 years ago

@writetome51/get-rounded-up-down v3.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

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';