PHP Classes


Recommend this page to a friend!
  Classes of Fernando Val   PHP Installment Payment Calculator   Download  
Role: Documentation
Content type: text/markdown
Description: Read me
Class: PHP Installment Payment Calculator
Calculate the amount of installments on loans
Author: By
Last change:
Date: 2 years ago
Size: 3,334 bytes


Class file image Download

PHP Installment Interest and Future Value Calculator

This class can calculate interest, future value, and monthly installment for a principal value with an interest rate for a given number of months.

Latest Stable Version Build Status PHP Composer PHPStan Codacy Badge StyleCI Total Downloads License


  • PHP 7.3+


To get the latest stable version of this component use:

"require": {
    "springy-framework/installment-calc": "*"

in your composer.json file.


I suppose that the following example is all you need:


require 'vendor/autoload.php'; // If you're using Composer (recommended)

// Creates the object. Only the principal value is requered in constructor.
$installment = new Springy\InstallmentCalc(

    Interst formula constants explained

    Springy\InstallmentCalc::FORMULA_SIMPLE - Simple interest
    Springy\InstallmentCalc::FORMULA_COMPOUND - Compound interest
    Springy\InstallmentCalc::FORMULA_BCB - Brazilian Central Bank interset formula

// Gets future amount for 12 months
echo $installment->getFutureAmount(12);

// Gets total interest for 12 months
echo $installment->getInterest(12);

// Gets monthly installment for 12 months
echo $installment->getMonthlyInstallment(12);

// Gets current principal amount
echo $installment->getPrincipalAmount();

// Gets current interest formula method
echo $installment->getFormulaMethod();

// Gets current interes rate
echo $installment->getInterestRate();

// Changes the principal amount value

// Changes the interest formula value

// Changes the interest rate value


Please read our contributing document and thank you for doing that.

Code of Conduct

In order to ensure that our community is welcoming to all, please review and abide by the code of conduct.


This project is licensed under The MIT License (MIT).