rjutils-collection
Advanced tools
Comparing version 1.0.5 to 1.0.6
{ | ||
"name": "rjutils-collection", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Easy and Lightweight Utilities", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -29,8 +29,11 @@ const path = require('path') | ||
* @param {Number} max The Maximum Number | ||
* @param {Number} [dec] The Decimal Places to Generate | ||
*/ | ||
randomNum(min, max) { | ||
randomNum(min, max, dec) { | ||
if (typeof min !== 'number') throw new TypeError('minimum must be a number') | ||
if (typeof max !== 'number') throw new TypeError('maximum must be a number') | ||
dec = dec || 0 | ||
const number = Math.floor(Math.random() * (max - min + 1)) + min | ||
const random = Math.random() * (max - min + 1) + min | ||
const number = Math.floor(random * (10 ** dec)) / (10 ** dec); | ||
return number | ||
@@ -37,0 +40,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11561
207