I have a number like this 12,345,678.09
which I would like to convert to 12.345.678,09
I am thinking of splitting a string with .
and changing the commas in the line for periods, and then adding them with a comma.
string value = "12,345,678.09"; string[] parts = value.Split(new char[]{'.'}); string wholeNumber = parts[0].Replace(",", "."); string result = String.Format("{0},{1}", wholeNumber, parts[1]);
I feel this method is very awkward. Any best practices?
source share