Utility for calculating gross profit, gross margin percentage, and markup percentage
Gross profit
margincalc.grossProfit(revenue, cost);
Gross margin percentage
margincalc.grossMarginPercentage(revenue, cost[, precision]);
Mark up percentage
margincalc.markUpPercentage(revenue, cost[, precision]);
The easiest way to get started is to add the following to your package.json
dependencies
{
"dependencies": {
"margin-calc": "git+ssh://[email protected]:thisiskeith/margin-calc.git",
}
}
Install the package
npm install
Require in your application
var margincalc = require('margin-calc');