1.0.1 • Published 8 years ago

random-altitude v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

random-altitude

Generate a random altitude, in meters.

MIT License

build:? coverage:?

Install

$ npm install --save random-altitude 

Usage

var randomAltitude = require('random-altitude');

// API
// - randomAltitude();
// - randomAltitude(options);

// options:
// - min  : default 0
// - max  : default 8488
// - fixed: default 5

randomAltitude();
// => 1863.21417

By default, includes 5 digits of accuracy after the decimal. Can override with the fixed option.

randomAltitude({ fixed: 7 })
// => 6897.8978386

By default, max of 8848m (height of Mount Everest), but this can be overridden with the max option.

randomAltitude({ max: 1000 })
=> 890.20665

Related

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.