How to replace the first comma with a dot in JavaScript

1 Answer

0 votes
let str = '7,849,127,092';

str = str.replace(/,/, '.');

console.log(str); 
  


  
/*
run:
  
"7.849,127,092"
  
*/

 



answered May 21, 2022 by avibootz

Related questions

2 answers 131 views
1 answer 114 views
1 answer 122 views
2 answers 138 views
2 answers 121 views
...