var round = function round(number, precision) {
  var shift = function shift(reverseShift) {
    var pre = reverseShift ? precision : -precision;
    var numArray = ('' + number).split('e');
    return +(numArray[0] + 'e' + (numArray[1] ? +numArray[1] + pre : pre));
  };
  return shift(Math.round(shift(number, precision, false)), precision, true);
};

export default round;