I created a method in a different class that calculates the amount of money the user would have after investing. I am trying to have the method return the value in standard format rather than in scientific notation. I've already tried looking up other answers of the same topic and this is what I got so far
DecimalFormat df = new DecimalFormat("#.##");
df.setMaximumFractionDigits(0);
endofyearamount = Double.valueOf(df.format(endofyearamount));
return endofyearamount;
However, when I run my main method I still get a value of
1.2902498E7
This is the code in my main method to display the return value in case you need to see it too.
double answer = formula.calculate(age, retiredage, monthlyinvestment, interestrate, investedperyear, endofyearamount, x, y );
System.out.println(answer);