Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Format Number for Display

Posted on 2004-09-30
2
Medium Priority
?
841 Views
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
0
Comment
Question by:champ_010
[X]
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
2 Comments
 
LVL 3

Accepted Solution

by:
chintan_vaishya earned 100 total points
ID: 12189438
HI,

Use this.

string.Format("{0:0,0.00}",12345332.8)

This gives output as,

12,345,332.80


This is exactly you want, i think

Good luck.
Chintan.
0
 
LVL 1

Author Comment

by:champ_010
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?

thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

705 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