MathContext mathContext = new MathContext(5,RoundingMode.HALF_UP); System.out.println(new BigDecimal(100.4767,mathContext));