Hello,
As the title suggests I have an issue with my number formatting code in my repeaters.
For some reason the formatting is interrupted and not executed every now and then… It happens when for example a filter is set or when you click the reset button. The very odd thing is that sometimes the formatting is applied only on some items and not on others.
See the screenshot below to better understand what I mean.
Please note that the price of the item to the left is not formatted but the item to the right is formatted correctly.
Here is the code I use right now:
$w.onReady(() => {
$w("#bilarDataset").onReady(() => {
$w('#carProductList').forEachItem( ($w, itemData, index) => {
const numberWithCommas = (x) => {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ".");
}
$w('#text68').text = numberWithCommas(parseInt($w('#text68').text)) + " kr";
} );
});
});
Any ideas to why this happens and what I should change in my code?
Many thanks in advance!
/Joe