Socket
Book a DemoInstallSign in
Socket

random-float

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

random-float

Generate a random float

Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
1.1K
14.88%
Maintainers
1
Weekly downloads
 
Created
Source

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.

License

MIT © Sindre Sorhus

Keywords

random

FAQs

Package last updated on 11 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts