From 2011a2940d5fd658b408601cae587e8bcd9485d3 Mon Sep 17 00:00:00 2001 From: Andros Fenollosa Date: Sat, 19 Feb 2022 17:37:55 +0100 Subject: [PATCH] Update index.ts --- src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 62dc7eb..67885f0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -144,14 +144,14 @@ export function cloneJSON(json: JSON): JSON { * @return {number} * @example * - * getRandom(0, 4) + * random(0, 4) * // => 3 (Maybe) * - * getRandom(0, 10, 2) + * random(0, 10, 2) * // => 8.31 (Maybe) * */ -export function getRandom(min: number, max: number, decimals: number=0): number { +export function random(min: number, max: number, decimals: number=0): number { const minRandom = Math.ceil(min); const maxRandom = Math.floor(max); return (Math.random() * (maxRandom - minRandom + 1) + minRandom).toFixed(decimals);