Helpful method I created a while ago…
private static double round (double value, int precision) {
int scale = (int) Math.pow(10, precision);
return (double) Math.round(value * scale) / scale;
}
try this
for example
DecimalFormat df = new DecimalFormat(“#.##”);
df.format(55.544545);
output:
55.54