Greetings:

This is a simple string formatting problem. I'm a little red-faced having to resort to this. However, I am following the rules for string formatting and it just seems to be getting ignored under ASP.NET using C#.

If I have a list of integers, like: 54, 123, 9, 1037 and I want to dump these into a list box on my WEB page, right-justified, like so:

54
   123
     9
  1037

Everywhere I look, it tells me that I should use the following string format specifier:

strNumber = string.format( "{0,5}", nNum );

But when I look at the output, I'm getting:

54
123
9
1037

I'm starting to think that "advanced" string formating is simply not supported in ASP.NET. Is this the problem?

Thanks in advance for responding.
Mark

ASP.Net lives elewhere... in a different forum.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.