code: function roundToNumber(num, place) {
      var newval=1*num;
  
      if(typeof(newval)=="number"){
        if(place<=0){
          var roundVal=-place;
          newval= +(Math.round(newval + "e+" + roundVal) + "e-" + roundVal);
        }
        else {
          var roundVal=place;
          var divval= "1e+"+roundVal;
          newval= +(Math.round(newval/divval))*divval;
        }
      }
      return(newval);
  }
docs: **************************************************