ngfw / loan-payment-calculator

Library for calculation full loan payments (principal, interest)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status Scrutinizer Code Quality Code Coverage SensioLabsInsight

loan-payment-calculator

Library to calculate full loan payments (with dates, periods, principal and interest amounts).

Basic usage

// $paymentAmountCalculator is insance of PaymentAmountCalculatorInterface
// $interestAmountCalculator is instance of InterestAmountCalculatorInterface
$calculator = new PaymentsCalculator($paymentAmountCalculator, $interestAmountCalculator);

$periods = $paymentPeriods; // must be instance of PaymentPeriodsInterface
$principal = 2000;
$interestRate = 20;
$calculationMode = 1 // see PaymentPeriodsInterface for available modes

$payments = $calculator->calculatePayments($periods, $principal, $interestRate, $calculationMode);

About

Library for calculation full loan payments (principal, interest)

License:MIT License


Languages

Language:PHP 100.0%