StringWithFormat min width
I know that this is possible, but can't seem to find it. I need to format a string (using stringWithFormat) with 3 0's when the value is <100.
So my integer i = 5, the string should be @"005", but 开发者_如何转开发I can't remember or find the format specifier to make this happen.
Hopefully this is low hanging fruit.
Thanks!
All I had to do was ask:
%03d works great.
精彩评论