I have a regex /\B(?=(\d{3})+(?!\d))/g which format the number into thousand's seperator. Like when you enter 752892, it gives me 752,892. I want to add to this regex not to allow decimal value and alphabets. How can we achieve this.
const THOUSANDS_SEPARATOR = ','
let i= (value || '').toString();
i= integer.replace(/\B(?=(\d{3})+(?!\d))/g, this.THOUSANDS_SEPARATOR);