1.0.1 • Published 8 years ago

random-longitude v1.0.1

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

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.