Sunday, November 17, 2019

How to add comma in number use javascript

if you need add comma in number used by javascript, you can add this function in your library

   function numberToCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home