OC数字格式化

NSNumberFormatter *formatter =[[[NSNumberFormatter alloc] init] autorelease];

formatter .formatWidth = 2;

formatter.paddingCharacter = @"0";

[formatter stringFromNumber:[NSNumber numberWithInt:8]]

 

结果为08

 

posted on 2012-09-12 17:25  androidabc08  阅读(187)  评论(0编辑  收藏  举报