Reputation: 1954
Here I have an
int x=3;
NSLog(@"%i", x);
How to have it displayed like "01"? and if x=12 to have it displayed like "12"? Thanks
Upvotes: 1
Views: 1737
Reputation: 14376
How about "%02d"
?
or "%02i"
?
(See man printf for formatting information or cocoadev NSLOG)
Upvotes: 10