Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js round to x decimal places

let roundOff = (num, places) => {
  const x = Math.pow(10,places);
  return Math.round(num * x) / x;
}
Source by learnersbucket.com #
 
PREVIOUS NEXT
Tagged: #js #decimal #places
ADD COMMENT
Topic
Name
5+8 =