I am trying to round up 5.1 to the next whole number. I tried using math round, but it only rounds it to 6 if the value is 5.5 or over.
int value = 51;
double dataPerPage = 10;
double amountOfPages = (double) value / dataPerPage;
System.out.println(value + "/" + dataPerPage + " = " + amountOfPages);
int sum = (int) Math.round(amountOfPages);
System.out.println("Total: " + sum);