jsm-utilities
Version:
A utilities library.
15 lines (14 loc) • 540 B
JavaScript
;
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"));
}