![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Mar 2005
Posts: 227
Rep Power: 4
![]() |
String formatting
Okay, tried a few things and just can't get this to work, what I'm TRYING to do is write out a number formated so it's always the same number of digits, would seem simple but...
I've tried int i=0;
String.Format("{0:00000000}",i.ToString());Which just seems to produce a single 0, instead of the 8 I'd like, I've also tried int i=0;
String.Format("{0:8}",i.ToString());Which is better because it puts in all the spaces to make it an 8 character, but still only puts a 0 as the final one, anyone have any ideas? I've tried googling it but a lot of topics explain how to make decimals appear, but not pre-numeric 0's. |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
Join Date: Mar 2005
Posts: 227
Rep Power: 4
![]() |
Re: String formatting
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| An Attempt at a DBMS | grimpirate | PHP | 8 | Apr 17th, 2007 1:01 PM |
| Throwing an exception when using string constructor | csrocker101 | C# | 3 | Apr 8th, 2007 2:04 PM |
| Help with breaking apart a string | csrocker101 | C# | 6 | Apr 6th, 2007 7:50 AM |
| Function Parameters | grimpirate | PHP | 10 | Mar 14th, 2007 6:55 PM |
| Problems with String to MD5 Conversion | emdiesse | Visual Basic .NET | 0 | Feb 2nd, 2006 10:25 AM |