How do I add a Dollar Sign to this Code?

Two more quick items for today:
Using this script to product a report I like to format the field "Sale Price" to include a Dollar sign.  It currently returns this:

Item Number Starting Date Ending Date Sale Price
COCO1G 2014-08-27 05:00:00 2014-08-31 23:59:00 37.85
COCO32Z 2014-08-27 05:00:00 2014-08-31 23:59:00 20.45
COCO8Z 2014-08-27 05:00:00 2014-08-31 23:59:00 7.75
COCOBALM14Z 2014-08-27 05:00:00 2014-08-31 23:59:00 19.85
COCOBALM32Z 2014-08-27 05:00:00 2014-08-31 23:59:00 36.65


$result = mysqli_query($con,"SELECT ItemNumber, StartingDate, EndingDate, SalePrice FROM biomas.ITProductSale where StartingDate >= CURDATE()");

 echo "<table border='1'>
 <tr>
 <th>Item Number</th>
 <th>Starting Date</th>
 <th>Ending Date</th>
 <th>Sale Price</th>
 </tr>";

 while($row = mysqli_fetch_array($result))
   {
   echo "<tr>";
   echo "<td>" . $row['ItemNumber'] . "</td>";
   echo "<td>" . $row['StartingDate'] . "</td>";
   echo "<td>" . $row['EndingDate'] . "</td>";
   echo "<td>" . $row['SalePrice'] . "</th>";
   echo "</tr>";
   }
 echo "</table>";
Scott JohnstonIT Manager Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GaryCommented:
Just add it

echo "<td>$" . $row['SalePrice'] . "</th>";

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Daniel ReynoldsSoftware Applications Developer / IntegratorCommented:
a rather simple way without attempting any formatting of the return value is to change the html you are sending.

while($row = mysqli_fetch_array($result))
    {
    echo "<tr>";
    echo "<td>" . $row['ItemNumber'] . "</td>";
    echo "<td>" . $row['StartingDate'] . "</td>";
    echo "<td>" . $row['EndingDate'] . "</td>";
    echo "<td> $" . $row['SalePrice'] . "</th>";
    echo "</tr>";
    }
  echo "</table>";
0
Scott JohnstonIT Manager Author Commented:
I appreciate your eyes today.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.