Hello,
I am using the printf function to display the rows from my query. Everything works fine, but I want to add a custom function that will format the $extended_price variable so that this number is displayed with commas for numbers in the thousands. The custom function that I created is called NumberWithCommas, and I want to call it within the prinf function. I tried doing it by adding ".NumberWithCommas($extended_price)." in place of $extended_price, but this did not give me the result I was looking for.
Is it possible to call another function within printf, or will I have to somehow modify that variable outside of that function?
revez2002
<?php
// Display each record returned by the query as a row
printf("
<tr>
<td width=\"10\"></td>
<td class=\"general_content_02_orange\" height=\"25\" width=\"280\" align=\"left\" valign=\"middle\"><input type=\"hidden\" name=\"%s\" value=\"%s\">%s</td>
<td width=\"110\" align=\"right\" valign=\"middle\"><input class=\"lite_green_02\" type=\"text\" name=\"%s\" value=\"%s\" style=\"width:70px;\"></td>
<td width=\"110\" align=\"right\" valign=\"middle\"><input class=\"lite_green_02\" type=\"text\" name=\"%s\" value=\"%s\" style=\"width:70px;\"></b></td>
<td class=\"general_content_02\" width=\"100\" align=\"right\" valign=\"middle\">$extended_price</td>
<td width=\"40\" align=\"right\" valign=\"middle\"><img border=\"0\" height=\"16\" width=\"17\" align=\"absmiddle\" src=\"content/projects/images/remove_checklist_item_button.jpg\"> </td>
</tr>\n",
$psq_ID_str, $row_psq["psq_ID"],
$row_psq["item_name"],
$units_quoted_str, $row_psq["units_quoted"],
$price_quoted_str, $row_psq["price_quoted"]);
?>