Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

compounder

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

compounder

Returns the total compounded value of an investment.

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

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.

Keywords

FAQs

Package last updated on 25 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc