So, as the title says I need to calculate the APR for a loan. I have the following:
apr = (rate * ((Math.Pow((1 + rate), duration))) /
((Math.Pow((1 + rate), duration)) - 1)) -
(installment / (loanamount - extracost));
But its not returning the correct value. I also tried another version of that equation with even worse results:
apr = ((loanamount + extracost) * rate * Math.Pow((1 + rate), duration)) / (Math.Pow((1 + rate),duration) - 1);
The calculations are all wrong. I tried adjusting some parenthesis and checking the order of operations. Any help would be greatly appreciated!