number-extended
number-extended
is a Javascript library that can contains different number utilities.
number-extended
can be used as a monad library that be be incorporated into extended
or used standalone.
var num = ; num; //10.00001
Or
var myextended = ; num; //10.00001
Installation
npm install number-extended
Or download the source (minified)
Usage
round
Rounds a number to the specified places.
//as a functionnum; //10num; //10.00001num; //10.001num; //10num; //10.001 //as a monadvalue; //10value; //10.00001value; //10.001value; //10value; //10.001
You can also provide an optional increment argument which rounds in the number in the specified increment.
console; //10.02console; //10.02console; //10.04console; //10.04console; //10.06console; //10.06console; //10.08console; //10.08console; //10.01
roundCeil
Rounds a number to the specified places, rounding up.
//as a functionnum; //10.01num; //10.00001num; //10.001num; //10.01num; //10.001num; //10.0 //as a monad; //10.01; //10.00001; //10.001; //10.01; //10.001; //10.0