标签:nsstring
//@"123456789" 转换后 @"123,456,789"
@interface NSString (num) - (NSString *)money; @end @implementation NSString (num) - (NSString *)money{ NSNumberFormatter *numFormat = [[NSNumberFormatter alloc] init]; [numFormat setNumberStyle:NSNumberFormatterDecimalStyle]; NSNumber *num = [NSNumber numberWithDouble:[self doubleValue]]; return [numFormat stringFromNumber:num]; } @end
标签:nsstring
原文地址:http://blog.csdn.net/yin_xianwei/article/details/39965051