You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
575 B
30 lines
575 B
4 weeks ago
|
# depth
|
||
|
|
||
|
```js
|
||
|
// usage
|
||
|
chance.depth()
|
||
|
chance.depth({ fixed: 2 })
|
||
|
chance.depth({ min: -1000 })
|
||
|
```
|
||
|
|
||
|
Generate a random depth, in meters. Depths are always negative
|
||
|
|
||
|
```js
|
||
|
chance.depth()
|
||
|
=> -2126.95039
|
||
|
```
|
||
|
|
||
|
By default, includes 5 digits of accuracy after the decimal. Can override with the `fixed` option.
|
||
|
|
||
|
```js
|
||
|
chance.depth({ fixed: 2 })
|
||
|
=> -1542.11
|
||
|
```
|
||
|
|
||
|
By default, maximum (or minimum depending on your frame of reference) depth of -2550 (depth of the Mariana Trench), but this can be overridden with the `min` option.
|
||
|
|
||
|
```js
|
||
|
chance.depth({ min: -1000 })
|
||
|
=> -718.41976
|
||
|
```
|