Forum Moderators: coopster
Get This <a href="<?=$row->offerurl?>"><?=$row->manufacturer?> <?=$row->phonemodel?> Phone <strong>
<? if ($row->rebateprice < 0.00)
{$row->rebateprice = number_format(abs($row->rebateprice),2);
print "Not just free, you make: <font color='#CC0000'>$ $row->rebateprice</font>"; }
elseif ($row->rebateprice == 0.00)
{$row->rebateprice = "$row->rebateprice";
print " Get it For <u>Free</u>! Cost: <font color='#CC0000'>$ $row->rebateprice</font>"; }
elseif ($row->rebateprice > 0.00)
{$row->rebateprice = "$row->rebateprice";
print "Cost: $<font color='#000000'>$row->rebateprice</font>"; }?>
I have the above code on my php page three times. When the price is == 0, everything works fine.
When the price is > 0, everything works fine.
When the prices is < 0, The first result says "Not just free, you make: $35.
The second and third result on the page, for the same value, says: Cost: $35.
Am I missing something? It only happens with the scenerio is less than 0.
Thanks for your help -!
jd
if ($row->rebateprice < 0.00)
{$row->rebateprice = number_format(abs($row->rebateprice),2);
print "Not just free, you make: <font color='#CC0000'>$ $row->rebateprice</font>"; }
From then on $row->rebateprice will be positive
Maybe do it like this
if ($row->rebateprice < 0.00)
{print "Not just free, you make:
<font color='#CC0000'>$ ".number_format(abs($row->rebateprice),2)."</font>"; }