We have a WPF desktop application that I need to refactor to support non-UK cultures. Clearly, decimal values can cause issues, for example where the decimal point character can differ in different regions ("." in UK but "," in France).
What I'm less clear on is the impact on integer values. For example we might have code that concatenates an integer value to generate an "ID", e.g.
var id = $"A{MemberNo}".
If the value of MemberNo is 12345 then I want the resulting string to be "A12345".
By introducing cultures into the mix, I'm concerned that some might result in, say, "thousands" separators being added to the string, e.g. "A12,345" (although after some testing, I've yet to find a culture where this does happen).
So my question is: when specifically converting integers to strings, will it always result in "12345" regardless of culture, or should I refactor such code to use InvariantCulture, e.g.
string.Format(CultureInfo.InvariantCulture, "A{0}", MemberNo);
There is a website that .NET uses for CultureInfo: https://icu.unicode.org/
I have tried a new CultureInfor("hi-IN") as a parameter for checking if Convert.ToString() changed an int to a string with separators and didn't get any (the website mentioned that this culture has separators in numbers).
Probably .NET will not be adding any separators to ints but if you need you can check with the link