mirror of
https://github.com/transmission/transmission
synced 2025-02-22 22:20:39 +00:00
When displaying file sizes in TB, show at most 2 fraction digits.
This commit is contained in:
parent
d855870cac
commit
58de3d3f93
1 changed files with 3 additions and 5 deletions
|
@ -29,8 +29,7 @@
|
|||
|
||||
@interface NSString (Private)
|
||||
|
||||
+ (NSString *) stringForFileSize: (uint64_t) size showUnitUnless: (NSString *) notAllowedUnit
|
||||
unitsUsed: (NSString **) unitUsed;
|
||||
+ (NSString *) stringForFileSize: (uint64_t) size showUnitUnless: (NSString *) notAllowedUnit unitsUsed: (NSString **) unitUsed;
|
||||
|
||||
+ (NSString *) stringForSpeed: (CGFloat) speed kb: (NSString *) kb mb: (NSString *) mb gb: (NSString *) gb;
|
||||
|
||||
|
@ -205,8 +204,7 @@
|
|||
|
||||
@implementation NSString (Private)
|
||||
|
||||
+ (NSString *) stringForFileSize: (uint64_t) size showUnitUnless: (NSString *) notAllowedUnit
|
||||
unitsUsed: (NSString **) unitUsed
|
||||
+ (NSString *) stringForFileSize: (uint64_t) size showUnitUnless: (NSString *) notAllowedUnit unitsUsed: (NSString **) unitUsed
|
||||
{
|
||||
double convertedSize;
|
||||
NSString * unit;
|
||||
|
@ -233,7 +231,7 @@
|
|||
{
|
||||
convertedSize = size / powf(1000.0, 4);
|
||||
unit = NSLocalizedString(@"TB", "File size - terabytes");
|
||||
decimals = 3; //guessing on this one
|
||||
decimals = 2;
|
||||
}
|
||||
|
||||
//match Finder's behavior
|
||||
|
|
Loading…
Reference in a new issue