0

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?

0

4 Answers 4

3

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

Sign up to request clarification or add additional context in comments.

Comments

1

Take a look please here, Number string format

Comments

0
string res = string.Format(CultureInfo.InvariantCulture, "{0:#,##0}", 3356890);

Comments

0
int val = 3356890;

string valString = val.ToString("#,##0")

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.