Skip to Content
๐ŸŽฒ Welcome to RandBox - Powerful JavaScript Random Data Generation Library! Learn More

depth

// usage randBox.depth() randBox.depth({ fixed: 2 }) randBox.depth({ min: -1000 })

Generate a random depth, in meters. Depths are always negative

randBox.depth() => -2126.95039

By default, includes 5 digits of accuracy after the decimal. Can override with the fixed option.

randBox.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.

randBox.depth({ min: -1000 }) => -718.41976
Last updated on: