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

@param input to round
@param decimals to round to
@return the rounded number
Rounds a number to the amount of decimals specified