java string format double decimal places code example
Example 1: java string format .2f
String.format("%.2f", 3.45);
Example 2: java format double no decimal places
int x = (int) y
String.format("%.2f", 3.45);
int x = (int) y