I have these two variables
double num = 540.512 double sum = 1978.8
Then I did this expression
double total = Math.round((
try this
for example
DecimalFormat df = new DecimalFormat("#.##"); df.format(55.544545);
output:
55.54