source: node_modules/es-toolkit/dist/math/round.js@ a762898

Last change on this file since a762898 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 362 bytes
Line 
1'use strict';
2
3Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
5function round(value, precision = 0) {
6 if (!Number.isInteger(precision)) {
7 throw new Error('Precision must be an integer.');
8 }
9 const multiplier = Math.pow(10, precision);
10 return Math.round(value * multiplier) / multiplier;
11}
12
13exports.round = round;
Note: See TracBrowser for help on using the repository browser.