I have a integer like this i.e 3356890
. I'm converting it to string and showing on screen.
Now I want to display like this 3,356,890
.
How to do?
I have a integer like this i.e 3356890
. I'm converting it to string and showing on screen.
Now I want to display like this 3,356,890
.
How to do?
You can use:
value = 1234567890;
Console.WriteLine(value.ToString("0,0", CultureInfo.InvariantCulture));
// Displays 1,234,567,890
However, for the purpose of internationalization and localization, it's probably best to allow the user's current culture settings to determine how to format the number.
Further Reading
string res = string.Format(CultureInfo.InvariantCulture, "{0:#,##0}", 3356890);