mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 12:28:52 +00:00
display terabytes for file size when applicable
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user