Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

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

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages