I convert the number:

int num = 1155; string end = Convert.ToString(num , 16).TrimStart('0')); 

The result is 483 in the end , and you need to get 0 483

  • one
    @andreycha, there is no duplicate, since it describes the specifiers, and here the TS needs formats. - Mirdin 7:49 pm
  • @Mirdin oh yes you are right. - andreycha

1 answer 1

 int num = 1155; string end = num.ToString("X8"); // end = @"00000483" 

Standard Number Format Strings