iOS OC文件大小计算
+ (NSString *)fileSizeWithInterge:(NSInteger)size{
if (size < 1024) {// 小于1k
return [NSString stringWithFormat:@"%ldB",(long)size];
}else if (size < 1024 * 1024){// 小于1m
CGFloat aFloat = size/1024;
return [NSString stringWithFormat:@"%.0fKB",aFloat];
}else if (size < 1024 * 1024 * 1024){// 小于1G
CGFloat aFloat = size/(1024 * 1024);
return [NSString stringWithFormat:@"%.1fMB",aFloat];
}else{
CGFloat aFloat = size/(1024*1024*1024);
return [NSString stringWithFormat:@"%.1fGB",aFloat];
}
}