Forum Moderators: coopster
I have db with a number of fields all populated, what I would like to do is get the COST from the db add uk vat then add MARKUP.
This is what I have so far.
<?php
function markup() {
$cost = $Scost;
$vat = '15';
$markup = $Smarkup;
$total = $Scost * $vat * $Smarkup;
echo $total;
}
?>
£<? echo markup($total) ?>
I hope this makes sense.
Vat is as you know 15% UK and the markup is just a number stored in the db which is 10 at the moment and should represent a percentage.
Thanks very much for yur time
Ski442
<p> <? echo $total = $Scost * (1+$SITEvat/100) * (1+$SITEmarkup/100);
$total = round($total, 2) ?>
All the values are called from the db, but how is this working without being in a fuction.
Would this be considered OK or not
The code works perfectly, your expert veiws please.
Thanks Ski442