Generate a random float
Switch branches/tags
Nothing to show
Clone or download
Latest commit 0f2a562 Nov 14, 2016
Permalink
Failed to load latest commit information.
.editorconfig init Jun 26, 2015
.gitattributes init Jun 26, 2015
.gitignore init Jun 26, 2015
.jshintrc init Jun 26, 2015
.travis.yml init Jun 26, 2015
index.js init Jun 26, 2015
license init Jun 26, 2015
package.json update tests for latest AVA version Dec 31, 2015
readme.md add related module Nov 14, 2016
test.js update tests for latest AVA version Dec 31, 2015

readme.md

random-float Build Status

Generate a random float

Install

$ npm install --save random-float

Usage

var randomFloat = require('random-float');

randomFloat(5);
//=> 4.401887938147411

randomFloat(10, 100);
//=> 72.34217455144972

API

randomFloat(max)

Returns an float from 0 to max.

randomFloat(min, max)

Returns an float from min to max.

min

Type: number
Default: 0

Minimum float to return.

max

Type: number
Default: 1

Maximum float to return.

Related

License

MIT © Sindre Sorhus