kaurikk / loan-amount-calculator
[Loan amount calculator library]
Installs: 592
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/kaurikk/loan-amount-calculator
Requires
- php: >=7.1
Requires (Dev)
- phpunit/phpunit: >=6.0
This package is not auto-updated.
Last update: 2023-04-25 17:09:41 UTC
README
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