math.js 134 B

123456
  1. const round = (val, d = 3) => {
  2. let factor = Math.pow(10, d);
  3. return Math.round(val * factor) / factor;
  4. };
  5. export default round;