Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dfridrich/mortage-calculator
Calculate mortage easily in PHP
https://github.com/dfridrich/mortage-calculator
Last synced: about 2 months ago
JSON representation
Calculate mortage easily in PHP
- Host: GitHub
- URL: https://github.com/dfridrich/mortage-calculator
- Owner: dfridrich
- Created: 2016-07-12T16:16:40.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-08-05T07:33:19.000Z (over 8 years ago)
- Last Synced: 2024-11-14T10:41:34.762Z (about 2 months ago)
- Language: PHP
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PHP Mortage Calculator
[![Build Status](https://img.shields.io/travis/dfridrich/mortage.svg?style=flat-square)](https://travis-ci.org/dfridrich/mortage)
[![Downloads](https://img.shields.io/packagist/dt/dfridrich/mortage.svg?style=flat-square)](https://packagist.org/packages/dfridrich/mortage)
[![Latest stable](https://img.shields.io/packagist/v/dfridrich/mortage.svg?style=flat-square)](https://packagist.org/packages/dfridrich/mortage)I went by train one day and I wanted to make some cool library, so I did this. Now you can **calculate mortage easily in PHP.**
## Install
`composer require dfridrich/mortage`
## Usage
```php
$mortage = new Defr\MortageRequest(1000000, 1.89, 20);
/** @var \Defr\MortageResult $result */
$result = $mortage->calculate();
```You can use `MortageResult`\`s getters for access values:
```php
object(Defr\MortageResult)[2]
private 'mortageRequest' =>
object(Defr\MortageRequest)[3]
private 'salePrice' => float 1000000
private 'mortgageInterestPercent' => float 1.89
private 'yearTerm' => int 20
private 'monthTerm' => int 240
private 'annualInterestRate' => float 0.0189
private 'monthlyInterestRate' => float 0.001575
private 'monthlyPayment' => float 5006.9030574862
private 'totalPayed' => float 1201656.7337967
private 'apr' => float 1.91
```## Credits
Orinally based on library from [Dave Tutfs](http://www.davetufts.com/).