How can I print a double
in standard notation?
double h = 104857600 - 32;
System.out.println(h);
Result:
1.04857568E8
Desired result:
104857568
How can I print a double
in standard notation?
double h = 104857600 - 32;
System.out.println(h);
Result:
1.04857568E8
Desired result:
104857568
You can use printf()
System.out.printf("%.0f", h);
The 0
is the precision, you can modify it.
Edit:
If you want to store it as a String
, you can use String.format("%.0f", h)
.