JSPM

compounder

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q28454F
  • License MIT

Returns the total compounded value of an investment.

Package Exports

  • compounder
  • compounder/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (compounder) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

compounder

A simple compound interest return calculator.

Returns the total compounded value of an investment.

CI npm

Installtion

pnpm add compounder

Usage

import compounder from 'compounder';

let totalValue = compounder({
    principal: 25000,
    interestRate: 12,
    compoundFrequency: "annually",
    years: 10,
});

console.log(totalValue);
// => 77646

API

compounder(parameters)

Returns the total compounded value of an investment.

Parameters (object):

• "principal"

Type: number
The principal amount of the investment.

• "interestRate"

Type: number
The rate of interest.

• "years"

Type: number
The number of years the investment is held for.

• "compoundFrequency" (optional)

Type: quarterly | semi-annually | annually | number
Default: annually

The frequency of compounding interest. By default, it is annually.
If a number is provided, it will be treated as the number of times the interest is compounded in a year.

• "shouldRound" (optional)

Type: boolean
Default: true

Whether to round the result to the nearest whole number.