Forums

Format a number within a Custom Listing

momentis 30 Jul, 2012
I have a CC connection set up, one field of which contains a decimal value. I would like to display this decimal in the site like "XXX,XXX.XX". The field name is 'cust_sales_quota', using a model ID of 'SalesCustomers'. I am trying to use the following logic within the body of the custom list display:

<td><?php
$quota = FIELD_NAME;
$showquota = number_format($quota,2);
echo $showquota; ?></td>


For FIELD_NAME, I have tried to call the 'cust_sales_quota' field LOADS of different ways, none of which works. What is the proper way to pull the value of this field into the above PHP script so I can display a formatted number?

Thanks!!
Rick
momentis 30 Jul, 2012
As usual, I figured it out JUST after posting this! 😶

The proper way to call the field is by using:

$quota = $row['SalesCustomers']['cust_sales_quota'];


Rick
This topic is locked and no more replies can be posted.