convert int to numeric (formatted) string

  • Thread starter Thread starter raulavi
  • Start date Start date
R

raulavi

vs2005 c#

hi:
need to convert a simple int to a format nnnn. if I have int 1 I want the
result to be padded with 0s as 0001 on a string

I have int 1 and I want "0001"

any help. Thanks

so far these dont work
field.ToString("nnnn") or field.ToString("####")
 
raulavi said:
hi:
need to convert a simple int to a format nnnn. if I have int 1 I want the
result to be padded with 0s as 0001 on a string

I have int 1 and I want "0001"

any help. Thanks

so far these dont work
field.ToString("nnnn") or field.ToString("####")

"0000" works fine.
 
Back
Top