display terabytes for file size when applicable
This commit is contained in:
parent
5b333ccc85
commit
66a7a1f220
|
@ -54,11 +54,16 @@
|
|||
convertedSize = size / 1048576.0;
|
||||
unit = NSLocalizedString(@"MB", "File size");
|
||||
}
|
||||
else
|
||||
else if (size < 1099511627776.0)
|
||||
{
|
||||
convertedSize = size / 1073741824.0;
|
||||
unit = NSLocalizedString(@"GB", "File size");
|
||||
}
|
||||
else
|
||||
{
|
||||
convertedSize = size / 1099511627776.0;
|
||||
unit = NSLocalizedString(@"TB", "File size");
|
||||
}
|
||||
|
||||
//attempt to have minimum of 3 digits with at least 1 decimal
|
||||
return [NSString stringWithFormat: convertedSize < 10.0 ? @"%.2f %@" : @"%.1f %@", convertedSize, unit];
|
||||
|
|
Loading…
Reference in New Issue