Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP Math , Percentages 1

Status
Not open for further replies.

JSProgramIA

Programmer
Oct 28, 2005
41
US
Yeah I know, this is simple High School stuff, but I must have skipped that day.

Code:
$unit_cost      = "45.00";
$selling_price  = "52.45";

$the_markup     = ???;        // Need percentage of markup  here

Embarrassingly thankful for any help.
 
Here ya go
Code:
$differnce = $selling_price - $unit_cost;

$the_markup = ($difference / $unit_cost) * 100;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top