I'm currently stuck trying the following.
I have managed to store two values as BigDecimals, I have also managed to divide these values and show the chosen amount of decimals.
Current fields:
BigDecimal latestPopulation, earliestPopulation, gip, divider;
Like so:
latestPopulation = new BigDecimal(aInterger.toString());
earliestPopulation = new BigDecimal(bInterger.toString());
divider = latestPopulation.divide(earliestPopulation, 10, RoundingMode.HALF_UP);
I then need to use the power of like so:
gip = divider.pow(1/cInterger);
However when I call System.out.println(gip);
it shows the result with no decimal places.
How do I define the number of decimal places I want?