Hello @god_prophet You can use this code:
function addThousandSeparator(number_as_string) {
let parts = number_as_string.split('.');
let integerPart = parts[0];
let decimalPart = parts.length > 1 ? '.' + parts[1] : '';
integerPart = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
...