@ssts/frac
Version:
Get a random fractional/decimal number within a range, between two numbers min and max.
24 lines (22 loc) • 637 B
TypeScript
/**
* Generates a random number between min and max.
* @param {number} min - required
* @param {number} max - required
* @returns {number} number
* @throws TypeError if either min, max or fractionDigits is NaN
* @throws RangeError if the fractionDigits is less than 0
*
* @example
* import seniorFRAC from "@ssts/frac";
* const randomDecimal: number = seniorFRAC(-10, 10);
*
* console.log(randomDecimal);
* // Log example: 8.158
*/
declare const seniorFRAC: (min: number, max: number, fractionDigits?: number) => number;
declare global {
interface Window {
ssts: any;
}
}
export { seniorFRAC as default };