How can I make a number show up as currency with 2 decimals and a comma for the thousands? In phpMyAdmin, I have a row type set up as an INT. Whenever I enter the amount, it rounds it and takes the decimals off. I tried setting it to DECIMAL, but then it adds two more decimals. So, instead of being 1,800, it comes out as 18. I tried the number format function and it worked but the cents were still rounded up and came out as 1800.00.
Here is how I did that, but I don't know if its the best way to do it because only one variable is set up for the number_format. I actually need 2 variables to have the number format.
$clientid = $row['clientid'];
$invoice = $row['invoice'];
$invoicedate = $row['invoicedate'];
$utilitytype = $row['utilitytype'];
$utilityco = $row['utilityco'];
$errortype = $row['errortype'];
$refundamt = $row['refundamt'];
$ourfee = $row['ourfee'];
$amount = $row['amount'];
$duedate = $row['duedate'];
$paid = $row['paid'];
$english_number_format = number_format($amount,2,'.',',');
echo "<tr>";
echo "<td>$invoice</td>";
echo "<td>$invoicedate</td>";
echo "<td>$utilitytype</td>";
echo "<td>$utilityco</td>";
echo "<td>$errortype</td>";
echo "<td>$refundamt</td>";
echo "<td>$ourfee</td>";
echo "<td>$english_number_format</td>";
echo "<td>$duedate</td>";
echo "<td>$paid</td>";
echo "</tr>";
Thanks!