Best way to figure out a percent markup.
Posted: Tue Apr 11, 2006 9:25 am
Ok, I gotta know what's the best way to figure out a mathematical function. I thought I figured it out, but it comes out different all the time. Here's what I did.
$markup is 20, for 20%. Which is why I added the period in front in line 3 for the 2nd $markup. I wanted to increase 5.00 by 20%, is what I'm trying to say. I dunno if that's the correct way, or if there's a better way. Help is well appreciated, thank you!
~RB
Code: Select all
$unitprice = '5.00';
$markup = 20;
$markup = $unitprice * ".$markup";
$unitprice = $unitprice + $markup;
echo $unitprice;~RB