Hi guys, I'm having a problem. I want to make numbers show as "00, 01, 02 ..." But it shows like "0, 1, 2 ..." I tried everything I found on internet. This is my last try. Code: Console.WriteLine("X = {0:D2}", 0); Console.WriteLine("X = {0:D2}", 1); Console.WriteLine("X = {0:D2}", 2); Console.WriteLine("X = {0:D2}", 3); Console.WriteLine("X = {0:D2}", 4); Console.WriteLine("X = {0:D2}", 5); Console.WriteLine("X = {0:D2}", 6); Console.WriteLine("X = {0:D2}", 7); Console.WriteLine("X = {0:D2}", 8); Console.WriteLine("X = {0:D2}", 9); But nothing worked. I need some help from you. Thank you so much.
This help https://docs.microsoft.com/en-us/dotnet/standard/base-types/how-to-pad-a-number-with-leading-zeros ?
As usual, MS docs add 500 mountains of crap like the good little gatekeepers they are. int Number = 500; Console.WriteLine(Number.ToString("D8")); This will output 8 total characters where the characters before the 500 are all 0s.