Jump to content

[SOLVED] fifteen percent


jakebur01

Recommended Posts

I am getting 15 percent of the item and adding it back to the item to get the Retail Price.

 

But when I hit an item around 1,000 it acts crazy and displays something like this:

# Walk-In Store Price:  2.30

# Your Internet Price: $2,799.00

 

It works fine when under 1,000 dollars.

Here is the code:

$phyprice = number_format($book['price'], 2);
$$phyprice =str_replace(',','',$phyprice);
$phypriceone = $phyprice * .15;
$phypricetwo = $phypriceone + $phyprice;
$phypricetwo = number_format($phypricetwo, 2);


    echo '<td><ul>';
    echo '<li><b>Type:</b> ';
    echo $book['author'];
    echo '</li><li><b>Item:</b> ';
    echo $book['isbn'];

 echo '</li><li><b>Description:</b> ';
    echo $book['description'];
   

    echo '</li><li><strike>Walk-In Store Price:</strike> ';
	echo "<strike> $phypricetwo</strike>";


   

 echo '</li><li><b>Your Internet Price:</b> ';
    $samicans = number_format($book['price'], 2);

echo '$';

echo "<b>$samicans</b>";


Link to comment
https://forums.phpfreaks.com/topic/59025-solved-fifteen-percent/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.