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 118 views
1 answer 105 views
1 answer 113 views
2 answers 127 views
2 answers 111 views
...