Need to muliple amount into single event

Silver Contributor
Silver Contributor parth_gupta199

Hi All,

Requirement is to add multiple amount into single event. Here amount can be 'n' number. So basically we need to add that and put it into an event.

Amount Pic.PNGAmount Picture

I'm using below code to extract the amount using javascript and jquery.

var qwe = $('.dt-right.amt-col').text().split("$");

qwe = ["853.60", "1,299.80", "637.29", "1,940.00"]

Now i need to add above decimal amount which is in array. Can someone help me to add this correctly? 

Not able to add above amount correctly with decimal digits.





Need to muliple amount into single event

Silver Contributor
Silver Contributor kevin_allen

Try something like this

total = 0;
qwe = $('.dt-right.amt-col').text().split("$");
for (let i = 0; i < qwe.length; i++) {
    total = total + parseFloat(qwe[i].replace(/,/g, ''));

Kevin Allen SAS-DCX-UXD
User Experience & Data Analytics
DevOps Engineer III
Swisscom (Schweiz) AG