ulbador macrumors 68000 Original poster Feb 11, 2010 1,554 0 Dec 1, 2010 #1 Is there a way to auto-pad this? Code: int checksum = 15; [NSString stringWithFormat:@"%X",checksum]; This comes out to be "0F" in hex. But as is, it just returns "F".
Is there a way to auto-pad this? Code: int checksum = 15; [NSString stringWithFormat:@"%X",checksum]; This comes out to be "0F" in hex. But as is, it just returns "F".
V vocaro macrumors regular Mar 5, 2004 120 0 Dec 1, 2010 #2 "%02X". Refer to the printf documentation: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html
"%02X". Refer to the printf documentation: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html
ulbador macrumors 68000 Original poster Feb 11, 2010 1,554 0 Dec 2, 2010 #3 vocaro said: "%02X". Refer to the printf documentation: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html Click to expand... Thanks for this. It was exactly what I needed.
vocaro said: "%02X". Refer to the printf documentation: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html Click to expand... Thanks for this. It was exactly what I needed.