Miss any of our Open RFC calls?Watch the recordings here! »

number-utils

1.0.5 • Public • Published

number-utils

Number utility methods.

Install

$ npm install number-utils

Usage

const numberUtils = require('number-utils');
 
numberUtils.isInteger(123);
// => true
numberUtils.isInteger(1.23);
// => false
numberUtils.isInteger('123');
// => false
 
numberUtils.random(5, 9);
// A random integer between 5 and 9.

API

MIN_SAFE_INTEGER

The constant represents the minimum safe integer in JavaScript.

MAX_SAFE_INTEGER

The constant represents the maximum safe integer in JavaScript.

boolean isInteger(value)

Determines whether the passed value is an integer.

boolean isSafeInteger(value)

Determines whether the provided value is a number that is a safe integer.

integer random(min, max)

Returns a random integer greater than or equal to "min" and less than or equal "max".

Resources

Install

npm i number-utils

DownloadsWeekly Downloads

22

Version

1.0.5

License

Apache-2.0

Unpacked Size

5.4 kB

Total Files

4

Last publish

Collaborators

  • avatar