- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
09-26-2019 05:19 AM
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 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.
Thanks
09-26-2019 07:10 AM - edited 09-26-2019 08:25 AM
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, ''));
}
Copyright All Rights Reserved © 2008-2023