JavaScript Margin & Cost Calculator Utilities

“Learn JavaScript, Deeply”

Matt Mullenweg, the creator of WordPress, in his yearly keynote “The State of Word” told the WordPress Community: “Learn JavaScript, Deeply”.I can’t say that I can straight up write JavaScript deeply, but I have been writing, editng and forging new code from existing JavaScript code for years. These are some examples of JavaScript and jQuery code I’ve written for clients in the past. It is surprisingly often that I find the need to fix JavaScript in my clients themes. ?

Percent Change Calculator

This is the percent increase or decrease for 2 numbers moving from the starting number to the ending number.
Enter Starting Amount
Enter Ending Amount
Calculated Result
Percentage Result
Use Result to Extend an Amt
Enter Base Amount
New Extended Result

Margin Calculator

This calculates the margin for items.
Enter Cost
Enter Price
Calculated Margin
Percentage Margin

Price Based On a Particular Margin Calculator

Enter CostCalculated Price is:Enter CostCalculated Price is:Enter CostCalculated Price is:Enter CostCalculated Price is:Enter CostCalculated Price is:Enter CostCalculated Price is:Enter CostCalculated Price is:Enter CostCalculated Price is:Enter CostCalculated Price is:Enter CostCalculated Price is:

This calculates the price you need for a particular margin.
Enter Desired Margin as a Decimal, e.g. .52 not 52
Enter all costs as decimal numbers, e.g. 10.25 not $10.25.
Enter Cost Calculated Price is:
Enter Cost Calculated Price is:
New Rows Require The Use of The Calculate Button After Entering the Value

Cost Based On a Particular Price and Margin Calculator

This calculates the cost you need for a particular margin, given the price.
Enter Desired Margin as a Decimal, e.g. .52 not 52
Enter all costs as decimal numbers, e.g. 10.25 not $10.25.
Enter Price Calculated Cost is:
Enter Price Calculated Cost is:
Enter Price Calculated Cost is:
Enter Price Calculated Cost is:
Enter Price Calculated Cost is:
Enter Price Calculated Cost is:
Enter Price Calculated Cost is:
Enter Price Calculated Cost is:
Enter Price Calculated Cost is:
Enter Price Calculated Cost is:
New Rows Require The Use of The Calculate Button After Entering the Value

math on chalkboard