double roundOff = Math.round(a * 100.0) / 100.0; // Or double roundOff = (double) Math.round(a * 100) / 100; // both have the same output.