// Returns a human-readable string showing the file size from the number of bytes
- (NSString *)stringFromFileSize:(int)theSize
{
float floatSize = theSize;
if (theSize<1023)
return([NSString stringWithFormat:@"%i bytes",theSize]);
floatSize = floatSize / 1024;
if (floatSize<1023)
return([NSString stringWithFormat:@"%1.1f KB",floatSize]);
floatSize = floatSize / 1024;
if (floatSize<1023)
return([NSString stringWithFormat:@"%1.1f MB",floatSize]);
floatSize = floatSize / 1024;
// Add as many as you like
return([NSString stringWithFormat:@"%1.1f GB",floatSize]);
}