int.ToString() format problem
C#
2
Posts
2
Posters
0
Views
1
Watching
-
hi, i want to know how can i make a fixed digits conversion like below C printf() function in c#? CString a; a.format("%02d, %02d, %02d", 1, 12, 123); thanks, jim
This should do the trick:
String.Format("{0:00} {1:00} {2:00}", 1, 12, 123)
Evaluates to:"01 12 123"
Check out the MSDN documentation on String.Format for more information: ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfsystemstringclassformattopic1.htm[^]