For your 1st questionDouble d = 1.12323423424;convert = new java.math.BigDecimal(d);yValue =convert.setScale(3,java.math.BigDecimal.ROUND_HALF_DOWN).doubleValue();The value of yValue will be 1.123.