File: depth.md

package info (click to toggle)
node-chance 2.2.6%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,612 kB
  • sloc: javascript: 16,572; makefile: 4
file content (29 lines) | stat: -rw-r--r-- 575 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# 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
```