round-off

1.0.0 • Public • Published

round-off

A faster way to round off a number towards 0 compared with Math.floor() and Math.ceil() http://www.jstips.co/en/rounding-the-fast-way/

Usage

var round = require('round-off');
 
console.log(round(-1.0001));
// -> -1
 
console.log(round(2.11));
// -> 2
 
console.log(round(null));
// -> Error: The input argument must be a number

Readme

Keywords

none

Package Sidebar

Install

npm i round-off

Weekly Downloads

2

Version

1.0.0

License

ISC

Last publish

Collaborators

  • vikramcse