Skip to content

Latest commit

 

History

History
37 lines (27 loc) · 918 Bytes

README.md

File metadata and controls

37 lines (27 loc) · 918 Bytes

margin-calc Circle CI codecov.io

Utility for calculating gross profit, gross margin percentage, and markup percentage

Usage

Gross profit

margincalc.grossProfit(revenue, cost);

Gross margin percentage

margincalc.grossMarginPercentage(revenue, cost[, precision]);

Mark up percentage

margincalc.markUpPercentage(revenue, cost[, precision]);

Installation

The easiest way to get started is to add the following to your package.json dependencies

npm i margin-calc -S

Require in your application

// ES5
var MarginCalc = require('margin-calc');

// ES6
import MarginCalc from 'margin-calc';