标签:
NSMutableString *newStr = [[NSMutableString alloc] initWithString:[NSString stringWithFormat:@"%ld",(long)_flowerNum]];
NSInteger insertPosition = newStr.length / 3;
NSInteger remaiderNum = newStr.length % 3;
NSInteger strLength = newStr.length;
if (strLength > 3) {
if (remaiderNum != 0) {
for (NSInteger i = 1; i <= insertPosition; i++) {
[newStr insertString:@"," atIndex:strLength - 3 * i];
}
}else{
for (NSInteger i = 1; i < insertPosition; i++) {
[newStr insertString:@"," atIndex:strLength - 3 * i];
}
}
}
标签:
原文地址:http://www.cnblogs.com/haohao-developer/p/5583680.html