java check if double has 2 decimal code example
Example 1: java double 2 decimal
String result = String.format("%.2f", value);
Example 2: java format double no decimal places
int x = (int) y
String result = String.format("%.2f", value);
int x = (int) y