You can use DecimalFormat to format the out put of numbers
package testproject;
import java.text.DecimalFormat;
public class Main {
public static void main(String[] args) {
double numberToRound = 12345.6789;
DecimalFormat df = new DecimalFormat("0");
System.out.println("Rounded number = " + df.format(numberToRound));
}
}
The output will be as
Rounded number = 12345
Let me know if you are unable to solve the problem with this.