random-longitude

Generate a random longitude.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
random-longitude
001.0.18 years ago8 years agoMinified + gzip package size for random-longitude in KB

Readme

random-longitude
Generate a random longitude.

MIT License
build:? coverage:?

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

Contributing

Pull requests and stars are highly welcome.
For bugs and feature requests, please create an issue.