I made a calculation in Excel and am trying to use it in PHP. Unfortunately, I do not get the correct total when I'm using the function as I wrote it.
This is the calculation as I am using it in Excel :
2500 / (( 0.25 / 100 ) / ( 1 - ( ( 1 + ( 0.25 / 100 )) ^ -360)))
The function I made for calculating in PHP:
function calculatesum($income, $interestmonthly, $months){
return $income / (( $interestmonthly / 100 ) / ( 1 - ( ( 1 + ( $interestmonthly / 100 ) ) ^ -$months)));
}
The function in PHP returns: '360000000' . But this should be '592.973,4538' .
I'm wondering what I'm doing wrong. Any tips will be welcome!
Already looked into the 'pow' functions, but still getting the same outcome.