Formatting the Output of the SUM workaround
Posted: 2023-12-18 19:04
In the post SUM lookup column ? an excellent solution for using the hooks folder to add a SUM to a lookup field was shown, and I have been able to make it work, except I would like to format the output in US dollars, and I can't figure out the best way to do it.
Thanks in advance for any assistance.
Thanks in advance for any assistance.
Code: Select all
case 'tableview':
$sum=sqlvalue("SELECT sum(Donations.Amount) from Supporters, Donations where Supporters.ID = Donations.SupporterID");
$header="<%%HEADER%%><script type=\"text/javascript\">
\$j(function(){
\$j('td.Supporters-TotalDonated').last().text(".$sum.").addClass('text-right');
});
</script>";
break;