code: public static double round(double d, int i) {
          double multiplier = Math.pow(10, i);
          return Math.round(d*multiplier)/multiplier;
      }
docs: Rounds a number to a specified precision.
  
  @param d
  @param i
  @return