Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 845
  • Last Modified:

Format Number for Display

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
champ_010
Asked:
champ_010
1 Solution
 
chintan_vaishyaCommented:
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
 
champ_010Author Commented:
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now