function round(number, step) {
	  if (step < 1) {
	    var places = getDecimalPlaces(step);
	    return parseFloat(number.toFixed(places));
	  }

	  return Math.round(number / step) * step;
	}
function round(number, step) {
	  if (step < 1) {
	    var places = getDecimalPlaces(step);
	    return parseFloat(number.toFixed(places));
	  }

	  return Math.round(number / step) * step;
	}
function round ( number , step ) { if ( step < 1 ) { var places = getDecimalPlaces ( step ) ; return parseFloat ( number . toFixed ( places ) ) ; } return Math . round ( number / step ) * step ; }
Round to the nearest step
Round to the nearest step