When displaying file sizes in TB, show at most 2 fraction digits.

This commit is contained in:
Mitchell Livingston 2012-07-05 00:18:15 +00:00
parent d855870cac
commit 58de3d3f93
1 changed files with 3 additions and 5 deletions

View File

@ -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