kaurikk / loan-amount-calculator
此包已被废弃,不再维护。没有建议替代包。
[贷款金额计算库]
0.0.3
2017-04-29 10:57 UTC
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
用于计算贷款利息和还款金额的库。包含两个主要部分
- 利息计算器
- 还款金额计算器(支持年金和等额本金还款)
基本用法
利息计算器
// 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