Giter VIP home page Giter VIP logo

capitaljs's Introduction

Capital.js Build Status

Installation

In a browser:

<script src="capital.js"></script>

Using npm:

$ npm install capitaljs

Usage

In a browser:

var rate = capitaljs.compoundAnnualGrowthRate({...});

In an AMD loader:

require(['capitaljs'], function(capitaljs) {...});

In Node:

var capitaljs = require('capitaljs');
var rate = capitaljs.compoundAnnualGrowthRate({...});

Or if you just want a single formula (to reduce your browser bundle's filesize):

var cagr = require('capitaljs/compoundAnnualGrowthRate');
var rate = cagr({...});

Current formulae:

Better docs and examples coming soon.

var amortization = require('capitaljs/amortization');

amortization({
  amount: 180000,
  rate: 4.25,
  totalTerm: 360,
  amortizeTerm: 60
});
var cash = require('capitaljs/cashFlow');

cash({
  income: 100000,
  expenses: 50000
});
var cagr = require('capitaljs/compoundAnnualGrowthRate');

cagr({
  startValue: 100000,
  endValue: 50000,
  years: 10
});
var iar = require('capitaljs/inflationAdjustedReturn');

iar({
  investmentReturn: .08,
  inflationRate: .03
});
var interest = require('capitaljs/interest');

interest({
  principal: 100000,
  rate: .06,
  years: 10,
  compounding: true
});
var roi = require('capitaljs/returnOnInvestment');

roi({
  earnings: 5000,
  initialInvestment: 100000
});

Contributing

Please read the Contributing guidelines.

Running Tests

$ npm test

License

The project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.

All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.

Software source code previously released under an open source license and then modified by CFPB staff is considered a "joint work" (see 17 USC § 101); it is partially copyrighted, partially public domain, and as a whole is protected by the copyrights of the non-government authors and must be released according to the terms of the original open-source license.

For further details, please see: http://www.consumerfinance.gov/developers/sourcecodepolicy/

capitaljs's People

Contributors

ascott1 avatar cfarm avatar contolini avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.