random-longitude

1.0.1 • Public • Published

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.

Package Sidebar

Install

npm i random-longitude

Weekly Downloads

415

Version

1.0.1

License

MIT

Last publish

Collaborators

  • bubkoo