@cjser/random-float
v3.0.0-cjser.2
Published
Generate a random float
Downloads
68
Maintainers
Readme
random-float
Generate a random float
Install
$ npm install random-floatUsage
import randomFloat from 'random-float';
randomFloat(5);
//=> 4.401887938147411
randomFloat(10, 100);
//=> 72.34217455144972API
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
- random-int - Generate a random integer
- random-item - Get a random item from an array
- random-boolean - Get a random boolean
- random-obj-key - Get a random key from an object
- random-obj-prop - Get a random property from an object
- unique-random - Generate random numbers that are consecutively unique
- unique-random-array - Get consecutively unique elements from an array
- crypto-random-string - Generate a cryptographically strong random string
cjser
This package is a CommonJS-compatible build generated by cjser for projects that still need require() support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.
Original repository: https://github.com/sindresorhus/random-float
