Format Number for Display

Posted on 2004-09-30
Last Modified: 2011-09-20
How can output a double or decimal with 2 numbers after the decimal, and a comma when it's supposed to for every 3 digits?  I also don't want a $ dollar sign.  

When I so String.Format("{0:c}" ) it give the dollar sign I don't want.

When I do Math.Round(myVariable) I don't get the comma at every 3rd digit.

Is there
Question by:champ_010

Accepted Solution

chintan_vaishya earned 25 total points
ID: 12189438

Use this.


This gives output as,


This is exactly you want, i think

Good luck.

Author Comment

ID: 12192329
hmmm...that will display the way i want alright--by any chance is there a way to keep it an integer type so that i can still perform calculations on it?


Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to close an web form using C# ? 4 44
Add a Condition in ASP Repeater 6 34
FInd Image Control Gridview 3 20 open new page without popup blocker 8 18
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on could not pull conte…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

840 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