Language: C#
Format an integer as a string with a culture specific thousand separator
1: int intValue = 1512; 2: string stringValue = intValue.ToString("#,#", CultureInfo.GetCultureInfo(Thread.CurrentThread.CurrentCulture.Name)); 3: /* Result in US English (en-US) will be 1,512 4: Result in Swedish (sv-SE) will be 1 512 */
Tags:
Comment:
Use C# to present numeric values as a string with a proper culture specific thousand separator, often used when presenting financial or market data.
Report Abuse
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search

