3 lines
117 B
JavaScript
3 lines
117 B
JavaScript
const round = (n, decimals = 0) => Number(`${Math.round(`${n}e${decimals}`)}e-${decimals}`);
|
|
module.exports = round;
|