NSNumberFormatter *formatter =[[[NSNumberFormatter alloc] init] autorelease];
formatter .formatWidth = 2;
formatter.paddingCharacter = @"0";
[formatter stringFromNumber:[NSNumber numberWithInt:8]]
结果为08
NSNumberFormatter *formatter =[[[NSNumberFormatter alloc] init] autorelease];
formatter .formatWidth = 2;
formatter.paddingCharacter = @"0";
[formatter stringFromNumber:[NSNumber numberWithInt:8]]
结果为08
转载于:https://www.cnblogs.com/androidabc/archive/2012/09/12/2682110.html