kaurikk/loan-amount-calculator

This package is abandoned and no longer maintained. No replacement package was suggested.

[Loan amount calculator library]

0.0.3 2017-04-29 10:57 UTC

This package is not auto-updated.

Last update: 2023-04-25 17:09:41 UTC


README

Build Status Scrutinizer Code Quality Code Coverage SensioLabsInsight

loan-amount-calculator

Library for calculating loan interest, payment amounts. Contains 2 main parts:

  • Interest calculator
  • Payment amount calculator (supports annuity and equal principal payments)

Basic usage

Interest calculator

// Rate for 30 days
$yearlyInterestRate = 360;
$ratePerPeriod = $yearlyInterestRate / 360 * 30;
// Present value from where interest is calculated
$presentValue = 5000;


$calculator = new InterestAmountCalculator();
$interestAmount = $calculator->getInterestAmount($presentValue, $ratePerPeriod);

echo $interestAmount; // 1500