por exemplo:
1000 = 1k
10000 = 10k
1000000 = 1M
etc..
+(NSString*)formatterNumber:(NSInteger)number
{
NSString *label = [NSString stringWithFormat:@"%d", number];
if(number>1000)
label = [NSString stringWithFormat:@"%.1fk", (float)number/1000];
if(number>10000)
label = [NSString stringWithFormat:@"%.1fk", (float)number/1000];
if(number>1000000)
label = [NSString stringWithFormat:@"%.1fM", (float)number/1000000];
if(number>10000000)
label = [NSString stringWithFormat:@"%.1fM", (float)number/1000000];
return label;
}
Vitor Yudi Hansen