JTLR
4/13/2017 - 7:53 AM

Javascript round to nth decimal place

Javascript round to nth decimal place

function round(value, decimals) {
  return Number(Math.round(value+'e'+decimals)+'e-'+decimals);
}