Format it accordingly. For instance:
System.out.printf("%.1f", 1654621658874684.0);
Remember that double is not infinitely accurate. It has an accuracy of 15 to 17 decimal digits. If you want arbitrary precision floating point numbers, use BigDecimal instead of double.
Or you can use String.format ():
System.out.println(String.format("%.0f", 1654621658874684.0d));
source
share