Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

readme.md

random-float Build Status

Generate a random float

Install

$ npm install random-float

Usage

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

randomFloat(5);
//=> 4.401887938147411

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

API

randomFloat(maximum?)

Returns an float from 0 to maximum.

randomFloat(minimum, maximum)

Returns an float from minimum to maximum.

minimum

Type: number
Default: 0

Minimum float to return.

maximum

Type: number
Default: 1

Maximum float to return.

Related

You can’t perform that action at this time.