Hi guys,
my input is 1.123,99
my output should be 1,123.99
the “,” should be replaced by “.” and the “.” should be replaced by “,”
Please help me out
Hi guys,
my input is 1.123,99
my output should be 1,123.99
the “,” should be replaced by “.” and the “.” should be replaced by “,”
Please help me out
The string length can vary. But both the symbols will be present in the string
Please try this,
input - your variable
replace . with @
, with .
and finally @ with , again
input.tostring.replace(".","@").replace(",",".").replace("@",",")
Thanks
thanks mate
Double.Parse("1.123,99",System.Globalization.CultureInfo.CreateSpecificCulture("de-DE"))
1123.99
Double.Parse("1.123,99",System.Globalization.CultureInfo.CreateSpecificCulture("de-DE")).toString("F2")
"1123.99"
Double.Parse("1.123,99",System.Globalization.CultureInfo.CreateSpecificCulture("de-DE")).toString("N2")
"1,123.99"
feel free to use another culture e.g. your specific local one