Jump to content

Can't make Formula in PHP


domcu

Recommended Posts

hi,

I am trying to write formula in php but two days work and nothing please someone help. Here is formula how look mathematic:

formula.jpg

 

here is how look in dynamic:

A=((N*(100-d)/100)*r*(1+r/1200)^(12*y))/(1200*((1+r/1200)^(12*y)-1))

 

here is how I write in php:

(($_POST['N']*(100 - $_POST['d'])/100)*$_POST['r']*(1+($_POST['r']/1200)pow(12*$_POST['y'])/(1200*((1+$_POST['r']/1200)*(12*$_POST['y'])-1));

 

but script don't work... Please help me,

Thank you very much and sorry for my english.

Link to comment
https://forums.phpfreaks.com/topic/44780-cant-make-formula-in-php/
Share on other sites

You are using the pow function incorrectly....

 

http://www.php.net/pow

 

$N = $_POST['N'];
$d = $_POST['d'];
$r = $_POST['r'];
$y = $_POST['y'];

$A = (N * ((100 - $d) / 100) * $r * pow((1 + ($r / 1200)), (12 * $y))) / (1200 * ( pow((1 + ($r / 1200)), (12 * $y)) - 1 ));

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.