From 6da7e7603c8828218468b72e6a102b586f48d493 Mon Sep 17 00:00:00 2001 From: pyoor Date: Thu, 13 Sep 2018 10:39:46 -0400 Subject: [PATCH] Fix frange arguments --- lib/make/numbers.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/make/numbers.js b/lib/make/numbers.js index 8faab16..c05145a 100644 --- a/lib/make/numbers.js +++ b/lib/make/numbers.js @@ -138,13 +138,13 @@ class number extends make { * Returns a float value within the supplied range * @param {number} min - Start value * @param {number} max - End value - * @param {number} precision + * @param {?number} precision * @returns {number} */ - static frange (min, max, precision) { + static frange (min, max, precision = null) { let x = Math.random() * (min - max) + max if (precision) { - let power = Math.pow(10, precision || 0) + let power = Math.pow(10, precision) x = Math.round(x * power) / power } return x