Skip to content

This module calculates the value of the initial investment based on rates of return (daily, monthly, semi-annual, annual...) 💰

License

Notifications You must be signed in to change notification settings

mohamedhayibor/compounding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

compounding

This module calculates the value of the initial investment based on rates of return (daily, monthly, semi-annual, annual...) 💰.

Installation

  > npm install compounding

Usage

Params: (initial investment, [%, %, %, %...])

caution: the result is a string, feel free to coerce it into a number if you need to.

import investmentValue from 'compounding' // or  const investmentValue = require('compounding')

investmentValue(1000, [0, 2, -10, 6]) // ===> "973.08"

Raison d'être

To make the calculation of how much your investment is worth now super easy. Just pass in the initial investment and the array of percentage returns (can be of any length as long as your browser or computer can support it). Algorithm complexity O(n).

Super Light (5 sloc). No dependencies.

License

© Mohamed Hayibor

About

This module calculates the value of the initial investment based on rates of return (daily, monthly, semi-annual, annual...) 💰

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published