首页 > 后端开发 > php教程 > 哪位高手能帮小弟我看看这是咋回事

哪位高手能帮小弟我看看这是咋回事

WBOY
发布: 2016-06-13 13:31:41
原创
939 人浏览过

谁能帮我看看这是怎么回事?
代码如下:
function amortizationTable($pNum,$periodicPayment,$balance,$monthlyInterest)
{
$paymentInterest=round ($balance*$monthlyInterest,2);
$paymentPrincipal=round ($periodicPayment-$paymentInterest ,2);
$newBalance=round ($balance-$paymentPrincipal,2);
if ($newbalance   $newBalance=0;
}

printf("

%d",$pNum);
printf("$%S",number_format($newBalance,2));
printf("$%S",number_format($periodicPayment,2));
printf("$%S",number_format($paymentPrincipal,2));
printf("$%S ",number_format($paymentInterest,2));
if($newBalance>0){
$pNum++;
amortizationTable($pNum,$periodicPayment,$newBalance,$monthlyInterest);
}else{
return 0;
}
}
$balance=10000.00;
$interestRate=.0575;
$monthlyInterest=$interestRate/12;
$termLength=5;
$paymentsPerYear=12;
$paymentNumber=1;
$totalPayments=$termLength*$paymentsPerYear;
$intCalc=1 + $interestRate/$paymentsPerYear;
$periodicPayment=$balance*pow($intCalc,$totalPayments)*($intCalc-1)/(pow($intCalc,$totalPayments)-1);
$periodicPayment=round($periodicPayment,2);
echo"";
echo"


";
aomrtizationTable($paymentNumber,$periodicPayment,$balance,$monthlyInterest);
echo"
Payment Number Balance Payment Principal Interest
";
?>
为什么显示的结果是下面的:

Fatal error: Call to undefined function aomrtizationTable() in C:\AppServ\www\test.php on line 38
Payment Number Balance Payment Principal Interest 


------解决方案--------------------
aomrtizationTable($paymentNumber,$periodicPayment,$balance,$monthlyInterest);
amo ... 不是 aom
------解决方案--------------------
注意大小写!
PHP code
function amortizationTable($pNum,$periodicPayment,$balance,$monthlyInterest) {
  $paymentInterest=round ($balance*$monthlyInterest,2);
  $paymentPrincipal=round ($periodicPayment-$paymentInterest ,2);
  $newBalance=round ($balance-$paymentPrincipal,2);
  if ($newBalance <td>%d</td>",$pNum);
  printf("<td>$%s</td>",number_format($newBalance,2));
  printf("<td>$%s</td>",number_format($periodicPayment,2));
  printf("<td>$%s</td>",number_format($paymentPrincipal,2));
  printf("<td>$%s</td>",number_format($paymentInterest,2));
  if($newBalance>0){
    $pNum++;
    amortizationTable($pNum,$periodicPayment,$newBalance,$monthlyInterest);
  }else{
    return 0;
  }
} <div class="clear">
                 
              
              
        
            </div>
登录后复制
相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板