Display a number with both comma seperators and NO decimal places?

Posted on 2006-06-14
Last Modified: 2010-04-16
C# application.


I've a double such as '34567', and I need to display this as label text as '34,567'.  Note that I do not want to display any decimal places.

I have managed to get the comma delimiters inserted by using:

NumberFormatInfo nfi = new CultureInfo( "en-US", true ).NumberFormat;
double GIA = 34567;
Label10.Text = GIA.ToString("N", nfi);

result = 34,567.00 <--NOTE that the result includes decimal places!

So the question once more is, how can I get both the comma delimiters AND no decimal places?

Thanks for your help.
Question by:NAORC
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 10

Accepted Solution

SystemExpert earned 500 total points
ID: 16901091

Label10.Text = GIA.ToString("0,00");


Expert Comment

ID: 16901216
The exact code with globalization is

double GIA = 34567;
NumberFormatInfo nfi = new CultureInfo( "en-US", true ).NumberFormat;
Response.Write(GIA.ToString("0,00", nfi));


Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor ( Top Charts is a view in which you can set seve…

687 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question