AmortizationCalculation
Overview
This module details an amortization calculation system that defines constants for various periodic intervals and events, as well as methods for managing loans, payments, rate changes, and schedule calculations. ## Constants
The module includes constants representing various time periods, such as annual, bi-annual, monthly, and weekly intervals, as well as unique identifiers like NUMBER_UNLIMITED
for unlimited occurrences and STARTDAY_NORMAL
for consistent start-day tracking. These constants simplify configuring amortization schedules with precise periodicity and event behaviors.
Methods
Key methods facilitate:
Loan and Payment Management: Functions like
addLoan
andaddPayment
support different configurations, including start and end dates, periodic intervals, and repetitions.Rate Changes and Period Adjustments:
addRateChange
andaddCompoundPeriodChange
enable dynamic updates to interest rates and compounding periods.Amortization Schedule Handling: Methods like
calculateAmortizationSchedule
andgetAmortizationSchedule
compute and retrieve detailed schedules, whilegetRestBalance
andsolveForUnknown
provide insights into financial balances and unknown variables.
Features
Utilities like
isValidPeriod
androundMoney
ensure input validity and precision.Event management and sorting (
sortEvents
,getEvents
) organize financial activities over time.
This module streamlines the creation and management of customized amortization schedules with precision and adaptability.
Constants Summarized
The numeric constant used to identify a bi-annual period (twice every year).
The numeric constant used to identify a bi-monthly period (twice every month).
The numeric constant used to identify a four-monthly period (once every four months).
The numeric constant used to identify a four-weekly period (once every four weeks).
The numeric constant used to identify a quarterly period (once every three months).
The numeric constant used to identify a two-monthly period (once every two months).
The numeric constant used to identify a two-weekly period (once every two weeks).
The numeric constant used to identify that the same start day should be used as the day of the month of the starting date of the event.
Methods Summarized
Returns all the amortization events - such as rate changes, loan events, payment events, compounding period changes.
Returns true if the period is valid, or false if the period is not valid.
Constants Detailed
NUMBER_UNLIMITED
The numeric constant used to identify an unlimited number of repeated events.
Type Number
Sample
PERIOD_ANNUALY
The numeric constant used to identify an annual period.
Type Number
Sample
PERIOD_BI_ANNUALLY
The numeric constant used to identify a bi-annual period (twice every year).
Type Number
Sample
PERIOD_BI_MONTHLY
The numeric constant used to identify a bi-monthly period (twice every month). TODO: this period is not supported yet.
Type Number
Sample
PERIOD_DAILY
The numeric constant used to identify a daily period.