bigdecimal divide java

Java
        BigDecimal mark1 = new BigDecimal("78");
        BigDecimal total = new BigDecimal("100");
        BigDecimal c = mark1.divide(total, 2, RoundingMode.HALF_UP);
Source

Also in Java: