formatting 1 to 001?

  • Thread starter Thread starter Oka Morikawa
  • Start date Start date
O

Oka Morikawa

Hi how it's possible to format eg. 1, 2, 3 to 001, 002, 003. With
..ToString() I'm able only to do some decimal formatting only?


Thanks,
Oka Morikawa
 
Oka Morikawa said:
Hi how it's possible to format eg. 1, 2, 3 to 001, 002, 003. With
.ToString() I'm able only to do some decimal formatting only?

Use number.ToString("000")
 
You need to use the right format string, such as:

X.ToString("000")
(1).ToString("000") ---> "001"
 
Back
Top