code: public static double round(double input, int decimals) {
          final double p = Math.pow(10, decimals);
          return Math.round(input * p) / p;
      }
docs: Rounds a number to the amount of decimals specified
  
  @param input to round
  @param decimals to round to
  @return the rounded number