random-altitude
v1.0.1
Published
Generate a random altitude, in meters.
Downloads
55
Maintainers
Readme
random-altitude
Generate a random altitude, in meters.
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
- random-depth - Generate a random depth, in meters. Depths are always negative.
- random-coordinates - Generate a random coordinates, which are latitude and longitude, comma separated.
- random-latitude - Generate a random latitude.
- random-longitude - Generate a random longitude.
- random-geohash - Generate a random geohash.
- random-geojson - Generate a random geojson.
- random-country - Return a random country.
- random-lang - Return a random language name.
Contributing
Pull requests and stars are highly welcome.
For bugs and feature requests, please create an issue.