You can take a look at the Math.round(double a) method. System.out.println(Math .round(12.51)) ...
stackoverflow.com