D
deadmanwalkin
i am bringing the variable $plant across from another html script and
trying to asign a price to the price variable buy using a if statment.
it only ever assigns the value of $price to the first value in the if
statment, or the last value in the if statment.
i would apreciate any help you can give asap.
below is script im using please let me know if it can be improved
im not looking for some one to fix if for me im looking for pointers in
the right direction.
code starts here
$VAT=17.5;
if ($Plant=="Japanese Anemones")
{
$Price= 7.90;
}
elsif ($Plant=="Bird of Paradise")
{
$Price= 5.90;
}
elsif ($Plant=="Flowering Geraniums")
{
$Price= 15.90;
}
elsif ($Plant=="Rose of Sharon")
{
$Price= 10.90;
}
$subttl=$Price*$VAT/100;
$total=$Price+$subttl;
printf "total including Vat is %9.2f\n",$total;
code end
trying to asign a price to the price variable buy using a if statment.
it only ever assigns the value of $price to the first value in the if
statment, or the last value in the if statment.
i would apreciate any help you can give asap.
below is script im using please let me know if it can be improved
im not looking for some one to fix if for me im looking for pointers in
the right direction.
code starts here
$VAT=17.5;
if ($Plant=="Japanese Anemones")
{
$Price= 7.90;
}
elsif ($Plant=="Bird of Paradise")
{
$Price= 5.90;
}
elsif ($Plant=="Flowering Geraniums")
{
$Price= 15.90;
}
elsif ($Plant=="Rose of Sharon")
{
$Price= 10.90;
}
$subttl=$Price*$VAT/100;
$total=$Price+$subttl;
printf "total including Vat is %9.2f\n",$total;
code end