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 127 views
1 answer 113 views
1 answer 102 views
1 answer 129 views
1 answer 144 views
2 answers 111 views
...