random-longitude
v1.0.1
Published
Generate a random longitude.
Downloads
2,968
Maintainers
Readme
random-longitude
Generate a random longitude.
Install
$ npm install --save random-longitude
Usage
var randomLongitude = require('random-longitude');
// API
// - randomLongitude();
// - randomLongitude(options);
// options:
// - min : default -180
// - max : default 180
// - fixed: default 5
randomLongitude();
// => 149.41549
By default, includes 5 digits of accuracy after the decimal. Can override with the fixed
option.
randomLongitude({ fixed: 7 })
// => 51.4549925
By default includes entire range of allowed longitudes, can specify a min and/or max to bound it:
randomLongitude({min: -78, max: -77});
// => -77.22644
Related
- random-latitude - Generate a random latitude.
- random-coordinates - Generate a random coordinates, which are latitude and longitude, comma separated.
- random-altitude - Generate a random altitude, in meters.
- random-depth - Generate a random depth, in meters. Depths are always negative.
- 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.