random-altitude

1.0.1 • Public • Published

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.

Package Sidebar

Install

npm i random-altitude

Weekly Downloads

5

Version

1.0.1

License

MIT

Last publish

Collaborators

  • bubkoo