Advertisement
Liliana797979

rounding fundamentals

Apr 19th, 2021
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function rounding(number, precision) {
  2.     let a = Number(number);
  3.     let b = Number(precision);
  4.    
  5.     if(b > 15) {
  6.         b = 15;
  7.     }
  8.  
  9.     a = a.toFixed(b);
  10.     console.log(parseFloat(a));
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement