source: node_modules/es-toolkit/dist/math/round.mjs@ ba17441

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

Added visualizations

  • Property mode set to 100644
File size: 268 bytes
RevLine 
[a762898]1function round(value, precision = 0) {
2 if (!Number.isInteger(precision)) {
3 throw new Error('Precision must be an integer.');
4 }
5 const multiplier = Math.pow(10, precision);
6 return Math.round(value * multiplier) / multiplier;
7}
8
9export { round };
Note: See TracBrowser for help on using the repository browser.