const numberWithCommas = (x) => {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
I have this function in which if a number is sent like 1223.00001
It will return like 1,223.00,001
but I would like to get 1,223.00001 ! I would like to get decimals without commas! This question is giving me different answer !