Simulasi KPR




$i=$_POST[‘kredit’];
$n=$_POST[‘waktu’];
$p=$_POST[‘bunga’];
function PMT($i,$n,$p){
$p/=1200;
$n*=12;
return ($i*$p)*(1/(1-(1/(pow((1+$p),$n)))));
}
$hasil=@PMT($i,$n,$p);
$rupiah=@number_format($hasil,’0′,’,’,’.’);
echo ”

Kredit : “.number_format($i,’0′,’,’,’.’).”
Waktu : “.$n.” tahun
Bunga : “.$p.” %
Cicilan : “.$rupiah.”

“;
?>