random-float
Generate a random float
Last updated a year ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install random-float 
SYNC missed versions from official npm registry.

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

Current Tags

  • 2.0.0                                ...           latest (a year ago)

2 Versions

  • 2.0.0                                ...           a year ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 7
Last Day 0
Last Week 3
Last Month 18
Dependencies (0)
None
Dev Dependencies (6)

Copyright 2014 - 2017 © taobao.org |