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

random-float

2.0.0 • Public • Published

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([maximumValue])

Returns an float from 0 to maximumValue.

randomFloat(minimumValue, maximumValue)

Returns an float from minimumValue to maximumValue.

minimumValue

Type: number Default: 0

Minimum float to return.

maximumValue

Type: number Default: 1

Maximum float to return.

Related

License

MIT © Sindre Sorhus

Install

npm i random-float

DownloadsWeekly Downloads

1,035

Version

2.0.0

License

MIT

Unpacked Size

4.47 kB

Total Files

5

Last publish

Collaborators

  • avatar