UNPKG

jsm-utilities

Version:
15 lines (14 loc) 540 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.roundNumberDecimals = void 0; exports.isNumberRange = isNumberRange; const roundNumberDecimals = (num, decimals = 0) => { return Math.round(num * Math.pow(10, decimals)) / Math.pow(10, decimals); }; exports.roundNumberDecimals = roundNumberDecimals; function isNumberRange(variable) { return (typeof variable === "object" && variable !== null && (typeof variable.min === "number") || (typeof variable.max === "number")); }