Rumah > Artikel > pembangunan bahagian belakang > 哪位高手能帮小弟我看看这是咋回事
谁能帮我看看这是怎么回事?
代码如下:
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("
Payment Number | Balance | Payment | Principal | Interest |
---|
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>