[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

Zero Fill a Integer Value

Barry

7/25/2008 8:25:00 AM

Hi

How do i get the following (add leading zeros to a numeric value after
converting to string)

0001
0002
0003
.....
......
......

TIA
Barry


1 Answer

Patrice

7/25/2008 9:16:00 AM

0

You could use MyInteger.ToString("0000").

See the ToString doc for details :
http://msdn.microsoft.com/en-us/library/8wc...




"Barry" <someone@hello.com> a écrit dans le message de groupe de discussion
: etjal$i7IHA.3648@TK2MSFTNGP03.phx.gbl...
> Hi
>
> How do i get the following (add leading zeros to a numeric value after
> converting to string)
>
> 0001
> 0002
> 0003
> ....
> .....
> .....
>
> TIA
> Barry
>