I've a string as 1,23,45,448.00
and I want to replace all commas by decimal point and all decimal points by comma.
My required output is 1.23.45.448,00
I've tried to replace ,
by .
as follow:
var mystring = 1,23,45,448.00
alert(mystring.replace(/,/g , .));
But, after that, if I try to replace .
by ,
it also replaces the first replaced .
by ,
resulting in giving the output as 1,23,45,448,00