| **Navigation:**  [[templates.htm|Templates]] > Guide to all Templates > [[additional libraries and templates.htm|Additional Libraries and Templates]] > Finance Library >====== COMPINT (compound interest) ====== | [[apr annual percentage rate .htm|{{btn_prev_n.gif|Previous page}}]][[additional libraries and templates.htm|{{btn_home_n.gif|Return to chapter overview}}]][[contint continuous compounding interest .htm|{{btn_next_n.gif|Next page}}]] | | || **COMPINT**(//principal,rate,periods//) | **COMPINT** | Computes total compounded interest plus principal. | | //principal// | A numeric constant or variable containing the beginning balance, initial deposit, or loan. | | //rate// | A numeric constant or variable containing the //applied interest rate// for the given time frame. | | //periods// | A numeric constant or variable containing the number of compounding periods per year. | The **COMPINT **function computes total interest based on a principal amount (//principal//), an applied interest rate (//rate//), plus the number of compounding periods (//periods//). The computed amount includes the original principal plus the compound interest earned. //Periods //specifies the number of compounding periods. For example, periods = 2 results in semi-annual compounding. Applied interest rate may be calculated as follows: PeriodicRate = AnnualInterestRate / (PeriodsPerYear * 100) AppliedRate = PeriodicRate * TotalPeriods **Return Data Type:     **DECIMAL **Internal Formulas:** {{compint.jpg|COMPINT.jpg}} **Example:** **CASE FIELD()** **OF ?OK** ** CASE EVENT()** ** OF EVENT:Accepted** **  PeriodicRate = AnnualInterestRate / (PeriodsPerYear * 100)  ! Setup Variables** **  ActualRate  = PeriodicRate * TotalPeriods** **  CompoundInterest = COMPINT(Principal,ActualRate,TotalPeriods) ! Call COMPINT** **  DO SyncWindow** ** END**