iphone - Int number 0000 cocos2d -
i have starting number work 0000 , increment one, have done, result 1,2,3 instead of 0001,0002,0003 etc. how can achieve this?
i use string:
stringa = [nsstring stringwithformat:@"score: %d",score];
thank you.
stringa = [nsstring stringwithformat:@"score: %04d",score];
should want.
"4" (minimum) field width, , "0" padding zeroes instead of spaces. stringwithformat
understands (almost) "printf" formats (which described in detail here: http://pubs.opengroup.org/onlinepubs/009695399/functions/printf.html ).
Comments
Post a Comment