node package manager
Love JavaScript? Your insights can make it even better. Take the 2017 JavaScript Ecosystem Survey »

compound-interest

compound-interest Build Status JavaScript Style Guide

compound interest of initial + series

installation

$ yarn add compound-interest

usage

const compound = require('compound-interest');
 
const opts = {
  initial: 1000,  // initial balance 
  monthly: 100,   // monthly addition 
  interest: 5,    // +% interest 
  compound: 12,   // compounding factor (1, 12, 365...) 
  years: 5       // years 
};
 
compound(opts); // 8083 
compound.verbose(opts); // [1000, 2279, 3623, 5036, 6522, 8083] 

license

mit