generate functionSun, 18 Dec 2022

jquery on input add commas

// add commas to number let numberWithCommas = (x) => { return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); } // ES5 function numberWithCommas(x) { return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); }

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant