add comma for input number automatically typescript

The solution for “add comma for input number automatically typescript” can be found here. The following code will assist you in solving the problem.

addCommas(x) {
var parts = x.toString().split(“.”);
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, “,”);
return parts.join(“.”);
}

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in