0.0.2 ā€¢ Published 6 years ago

finanza v0.0.2

Weekly downloads
6
License
ISC
Repository
github
Last release
6 years ago

Finanza šŸ’°

Simple library to perform common personal financial operations

Install

$ npm install finanza

Usage

calculateMonthlyPayment

const monthlyPayment = calculateMonthlyPayment({
  principal: 15812.0,
  monthlyInterestInPercentage: 1.17,
  noOfMonths: 9
});

console.log(monthlyPayment); //  1861.2606240059595

calculateAmortization

const AM = calculateAmortization({
  principal: 15812.0,
  monthlyPayment: 1860.96,
  monthlyInterestInPercentage: 1.17,
  firstPaymentDate: "2018-06-15",
  noOfMonths: 9
});

/* console.log(AM) šŸ‘‡
[ { currentInterest: 185.00039999999998,ā€‹ā€‹ā€‹ā€‹ā€‹
ā€‹ā€‹ā€‹ā€‹ā€‹    currentPrinciple: 1675.9596000000001,ā€‹ā€‹ā€‹ā€‹ā€‹
ā€‹ā€‹ā€‹ā€‹ā€‹    endingBalance: 14136.0404,ā€‹ā€‹ā€‹ā€‹ā€‹
ā€‹ā€‹ā€‹ā€‹ā€‹    currentPaymentDate: Fri Jun 15 2018 00:00:00 GMT+0530 (IST),ā€‹ā€‹ā€‹ā€‹ā€‹
ā€‹ā€‹ā€‹ā€‹ā€‹    pastDate: true },ā€‹ā€‹ā€‹ā€‹ā€‹
...
ā€‹ā€‹ā€‹ā€‹ā€‹  { currentInterest: 21.554225914525635,ā€‹ā€‹ā€‹ā€‹ā€‹
ā€‹ā€‹ā€‹ā€‹ā€‹    currentPrinciple: 1839.4057740854744,ā€‹ā€‹ā€‹ā€‹ā€‹
ā€‹ā€‹ā€‹ā€‹ā€‹    endingBalance: 2.835757070562977,ā€‹ā€‹ā€‹ā€‹ā€‹
ā€‹ā€‹ā€‹ā€‹ā€‹    currentPaymentDate: Fri Feb 15 2019 00:00:00 GMT+0530 (IST),ā€‹ā€‹ā€‹ā€‹ā€‹
ā€‹ā€‹ā€‹ā€‹ā€‹    pastDate: false } ]ā€‹ā€‹ā€‹ā€‹ā€‹

*/

Note Month starts with 0-index in js. Make sure you pass proper month.

daysUntilDebtFree

daysUntilDebtFree({ amortizationList: AM }); // 242

License

MIT Ā© Ashik Nesin