1.1.1 • Published 5 years ago

@terryx/fmath v1.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

FMATH

Fmath has several utility math functions.

Installation and Usage

npm install @terryx/fmath

Compound Calculator

import { CompoundCalculator } from '@terryx/fmath'

// Calculate compound 200 dollar over 20 years with 5% gain each year
const result = CompoundCalculator.simple(200, 20, 5) // 530.66

Percentage Calculator

import { PercentageCalculator } from '@terryx/fmath'

// Calculate increase/decrease of 2 values
const diff = Pc.difference(500, 850) // 70

// Calculate original value given a percent value
const origin = Pc.origin(1000, -10) // 900