Changeset 13369


Ignore:
Timestamp:
Jul 5, 2012, 12:18:15 AM (9 years ago)
Author:
livings124
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/NSStringAdditions.m

    r13357 r13369  
    3030@interface NSString (Private)
    3131
    32 + (NSString *) stringForFileSize: (uint64_t) size showUnitUnless: (NSString *) notAllowedUnit
    33     unitsUsed: (NSString **) unitUsed;
     32+ (NSString *) stringForFileSize: (uint64_t) size showUnitUnless: (NSString *) notAllowedUnit unitsUsed: (NSString **) unitUsed;
    3433
    3534+ (NSString *) stringForSpeed: (CGFloat) speed kb: (NSString *) kb mb: (NSString *) mb gb: (NSString *) gb;
     
    206205@implementation NSString (Private)
    207206
    208 + (NSString *) stringForFileSize: (uint64_t) size showUnitUnless: (NSString *) notAllowedUnit
    209     unitsUsed: (NSString **) unitUsed
     207+ (NSString *) stringForFileSize: (uint64_t) size showUnitUnless: (NSString *) notAllowedUnit unitsUsed: (NSString **) unitUsed
    210208{
    211209    double convertedSize;
     
    234232        convertedSize = size / powf(1000.0, 4);
    235233        unit = NSLocalizedString(@"TB", "File size - terabytes");
    236         decimals = 3; //guessing on this one
     234        decimals = 2;
    237235    }
    238236   
Note: See TracChangeset for help on using the changeset viewer.