0

Possible Duplicate:
.NET String.Format() to add commas in thousands place for a number

I have an int that is passed through to the a view and it need to formatting so it is not one big block of number. e.g

0
00
000
000,0
000,000
000,000,000

How can i do this using a for loop?

thanks

Community
  • 1
  • 1

1 Answers1

0

You may want to output the integer as i.ToString("###,###,###");

However, this would not display a value if the int is 0.

You could try using System.Drawing.Color to represent the colour value rather than an int. This has a method ToArgb()

Dangerous
  • 4,818
  • 3
  • 33
  • 48