I have a Java BigDecimal expression like below:
(totalPrep.divide(totalCase, 2, BigDecimal.ROUND_HALF_UP)).multiply(new BigDecimal(100))
where
BigDecimal totalCase = BigDecimal.ZERO; BigDecimal totalPrep = BigDecimal.ZERO;
I have to divide totalPrep with totalCase and the result is multiplied with 100 to get result value in %. 66.6666666666666666666666666666666666667
Say total prep is bidecimal 2 and toalCase is 3,then the math results in 66.6666666666666666666666666666666666667. I want to concat this to 2 decimal places 66.67%
Any suggestions?