How to replace the first comma with a dot in Node.js

1 Answer

0 votes
let str = '12,449,327,098';
 
str = str.replace(/,/, '.');
 
console.log(str); 
   
 
 
   
/*
run:
   
12.449,327,098
   
*/

 



answered May 21, 2022 by avibootz

Related questions

2 answers 246 views
1 answer 199 views
1 answer 184 views
1 answer 241 views
1 answer 263 views
2 answers 220 views
...