Click to See Complete Forum and Search --> : 1 must be 001


da_cobra
August 24th, 2007, 12:52 PM
What if I have an integer and I want to display it begining with "0", so that the length of the string is always 3 characters?

so :

"1" becomes "001"
"50" becomes "050"

Is there a standard method that can do this, or do I have to create one myself?

S_M_A
August 24th, 2007, 01:40 PM
string str = 'integerVar'.ToString("d3");

da_cobra
August 24th, 2007, 01:43 PM
thx alot!!!!