Is int.ToString(CultureInfo.InvariantCulture) necessary?
c#
Solution
You shouldn't only consider cultures, but also human beings that set their Windows regional settings to have a weird negative sign, or other parameters.
Yes, you can actually set those:
I guess there is (almost) no one setting this, but better safe than sorry. Also, I won't assume you don't have to deal with negatives. Some day you will, and then this code will still work. Robust coding is better than assuming.
Problem
Is there a culture that doesn't use dashes (-) for negative numbers? If I won't have to deal with negative numbers, would int.ToString() yield the same string of numbers in all cultures? I have a piece of code with int.ToString(CultureInfo.InvariantCulture) and I want to make sure I can simplify it and remove the InvariantCulture parameter.