Files
artcraft/packages/components/src/utils/GetRandomInt.ts
T
Brandon Thomas b3f4477dd2 Fix for Vocodes v1 removal
Mistakenly deleted files with function still in use
2022-07-10 02:05:53 -04:00

12 lines
285 B
TypeScript

/**
* Generate a random integer in range.
* @param min minimum inclusive
* @param max maximum exclusive
*/
export function GetRandomInt(min: number, max: number) : number {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min)) + min;
}