I have these two variables
double num = 540.512 double sum = 1978.8
Then I did this expression
double total = Math.round((
Double number = new Double("5.25"); Double tDouble = new BigDecimal(number).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue();
this will return it will return 5.3