@toolsnap/financial-calculator-formulas
v1.0.0
Published
Common financial calculation formulas: mortgage, ROI, loan payment, compound interest, inflation adjustment.
Maintainers
Readme
@toolsnap/financial-calculator-formulas
Pure JavaScript financial calculation formulas for mortgage, ROI, compound interest, and inflation.
Installation
npm install @toolsnap/financial-calculator-formulasUsage
const { mortgagePayment, returnOnInvestment } = require('@toolsnap/financial-calculator-formulas');
// $300k mortgage at 6.5% for 30 years
const mortgage = mortgagePayment(300000, 0.065, 30);
console.log(mortgage);
// { monthly: 1896.2, totalInterest: 382633.8, totalPaid: 682633.8 }
// ROI on $10k investment that grew to $15k in 3 years
const roi = returnOnInvestment(10000, 15000, 3);
console.log(roi);
// { roi: 50, annualized: 14.47, profit: 5000 }Included Functions
mortgagePayment(principal, rate, years)— Monthly payment, total interest, total paidreturnOnInvestment(initial, final, years)— ROI %, annualized return, profitcompoundInterest(principal, rate, years, n)— Future value with compoundinginflationAdjust(amount, rate, years)— Real value after inflation
About
For interactive online calculators with more features, visit RiseTop — 100+ free tools, no signup required.
License
MIT
