@tdb/util
Version:
Shared helpers and utilities.
17 lines • 545 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function round(value, precision) {
if (precision === void 0) { precision = 0; }
var multiplier = Math.pow(10, precision || 0);
return Math.round(value * multiplier) / multiplier;
}
exports.round = round;
function random(min, max) {
if (min === void 0) { min = 0; }
if (max === undefined) {
max = min + 999;
}
return Math.floor(Math.random() * (max - min + 1) + min);
}
exports.random = random;
//# sourceMappingURL=value.math.js.map