I agree this is a commonly raised issue with newb programmers.
I guess the easiest explanation i have given in the past is that from an internal system perspective you dont need the leading 0's as the take up space when stored in a database. To this extent the leading zeros are only used for presentation.
psuedo VB code.
dim iNum as integer
dim sString as string
dim sOutput
sString = "000000"
iNum = 1
sOutput = RIGHT (sStr & cStr(iNum),6)
'from the above the sOutput would be left as "000001"
if you then need to read the int value simply cInt(sOUtput) would return 1
sorry for the vb but i am not a c# programmer.
regards,
D
ps. if this post has helped please press the star and leave some rep.
