[Solved] Java: I want to get an Integer output in double datatype


You can use NumberFormat; the #-sign mean that decimals are only shown if they’re non-zero.

System.out.println("Value in " + new DecimalFormat("0.########").format(m));

solved Java: I want to get an Integer output in double datatype