0.0.2 • Published 9 years ago

random-number-with-range v0.0.2

Weekly downloads
7
License
MIT
Repository
github
Last release
9 years ago

random-number-with-range Build Status

Random number with range

Install

$ npm install --save random-number-with-range

Usage

const randomNumberWithRange = require('random-number-with-range');

randomNumberWithRange(1, 50);
//=> Float random between 1 and 50 inclusive

randomNumberWithRange(20, 80, true)
//=> Integer random between 20 and 80

API

randomNumberWithRange(min, max, isRound)

min

Type: number

Minimum value possible value to return.

max

Type: number

Maximum value possible value to return.

options

isRound

Type: boolean Default: false

Whole number returned is Float or Integer. Default is Float.

License

MIT © Dang Van Thanh