How to Currency Symbol and Change Format of the SUM Number?

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
mohamed
Veteran Member
Posts: 80
Joined: 2020-04-19 16:18

How to Currency Symbol and Change Format of the SUM Number?

Post by mohamed » 2020-10-03 08:31

Hello,

When I select Show Column Sum of a filed, the following code is generated in the related PHP file !!!!_View.php


$x->HTML = str_replace('<!-- tv data above -->', $sumRow, $x->HTML);


For instance the total is 1450

I am wondering,
1. How to add the currency symbol to it ? e.g., $ 1450

2. How to format the Total Number with; 1000 comma separator ? e.g., 1,450

3. How to format the Total number with; 2 Decimal points ? e.g., 1,450.00
THANK YOU...
AppGini Pro 24.11 -
Calendar - Search Page Maker - Summary Reports - Mass Update - DataTalk -
bizzworxx AppGini Helper JabaScript Library - bizzworxx Inline Detail-View - bizzworxx Helper Pack - AppGini Helper Packaging Tool -
Udemy course

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: How to Currency Symbol and Change Format of the SUM Number?

Post by pbottcher » 2020-10-03 19:17

Hi,
you could change that line to


$x->HTML = str_replace('<!-- tv data above -->', '$ '.number_format($sumRow, 2, '.', ','), $x->HTML);
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

mohamed
Veteran Member
Posts: 80
Joined: 2020-04-19 16:18

Re: How to Currency Symbol and Change Format of the SUM Number?

Post by mohamed » 2020-10-18 20:29

Hi pböttcher,

Thank you :)
THANK YOU...
AppGini Pro 24.11 -
Calendar - Search Page Maker - Summary Reports - Mass Update - DataTalk -
bizzworxx AppGini Helper JabaScript Library - bizzworxx Inline Detail-View - bizzworxx Helper Pack - AppGini Helper Packaging Tool -
Udemy course

Post Reply