The 02 part tells format() to use at least 2 digits and to use zeros to pad it to length, x <br />means lower-case hexadecimal.<br />
+
+
The Format Specification Mini Language also gives you X for uppercase hex output, and you can <br />prefix the field width with # to include a 0x or 0X prefix (depending on wether you used <br />x or X as the formatter). Just take into account that you need to adjust the field width <br />to allow for those extra 2 characters:<br />