Q:

Why does a number that's formatted with .ToString("X4") have characters in it?

I have this code:
vm.Info0 = phrase.PhraseNum.ToString("X4");

What I wanted was for the number to be formatted with some leading zeros like this:
00001
00222
00034

But instead what I see are some characters 3607 displayed as 0E17
Can anyone tell me what's happening and why it changes the number?

A:

If you want decimal number in the output you should use .ToString("D4");.
You can check the documentation here.

