I have an integer variable with max value of 9999.
I can convert to fixed length string (4-characters):
value.ToString(\"0000\");
a
String.Format( "{0:X2}", intValue)