@sapphire/utilities
Version:
Common JavaScript utilities for the Sapphire Community
16 lines (14 loc) • 428 B
JavaScript
import { __name } from '../chunk-PAWJFY3S.mjs';
// src/lib/roundNumber.ts
function roundNumber(input, decimals = 0) {
const value = Number(input);
if (decimals === 0) {
return Math.round(value);
}
const scale = 10 ** decimals;
return Math.round(value * scale) / scale;
}
__name(roundNumber, "roundNumber");
export { roundNumber };
//# sourceMappingURL=roundNumber.mjs.map
//# sourceMappingURL=roundNumber.mjs.map