mzs-randomnumber
v1.1.2
Published
Simple random number generator
Downloads
7
Readme
Random Number Generator
This package will return a random number from the min to < max.
The function takes 3 parameters:
- first parameter: minimum number you want the value to return
- second parameter: maximum number in range, if you want 1 - 10 and wish to have the possible of 10, you would use (1, 11).
- third parameter: is default to int=false, therefore it will return a decimal. If you want an integer, add the 3 parameter of true.
Installation
npm i mzs-randomnumber
Usage
const randomNumGenerator = require('mzs-randomnumber')
randomNumGenerator(minNumber, maxNumber)
Returns a decimalrandomNumGenerator(minNumber, maxNumber, true)
Returns an integer
Tests
Run node test.js
and ensure the first number is decimal and the second is integer.