centralapps / mortgage-calculator
A class for calculating remaining amounts on a mortgage
Installs: 154
Dependents: 0
Suggesters: 0
Security: 0
Stars: 16
Watchers: 2
Forks: 7
Open Issues: 0
pkg:composer/centralapps/mortgage-calculator
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2025-10-07 08:03:44 UTC
README
Calculates monthly repayment and monthly interest-only costs for a mortgage.
Example
require_once 'vendor/autoload.php';
$calculator = new CentralApps\MortgageCalculator\Calculator();
$calculator->setAmountBorrowed( 125000 );
$calculator->setInterestRate( 6 );
$calculator->setYears( 25 );
echo 'Monthly repayment costs £' . $calculator->calculateRepayment() . PHP_EOL;
echo 'Monthly interest-only costs £' . $calculator->calculateInterestOnlyPayment() . PHP_EOL;
Change log
- Cleaned up some code, added composer.json support
- Initial version of the library
Todo
- Abstract mortgage to a separate class, support calculating things like repayment time left, total repayment amount, and so on