From 58de3d3f9387e782c0fee2818bb3ce53d68f69f8 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Thu, 5 Jul 2012 00:18:15 +0000 Subject: [PATCH] When displaying file sizes in TB, show at most 2 fraction digits. --- macosx/NSStringAdditions.m | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/macosx/NSStringAdditions.m b/macosx/NSStringAdditions.m index baeb1915c..8884a085b 100644 --- a/macosx/NSStringAdditions.m +++ b/macosx/NSStringAdditions.m @@ -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