Changeset 11351


Ignore:
Timestamp:
Oct 24, 2010, 6:06:32 PM (11 years ago)
Author:
livings124
Message:

slight change to the file size formatting function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/NSStringAdditions.m

    r11207 r11351  
    5050{
    5151    const CGFloat baseFloat = [NSApp isOnSnowLeopardOrBetter] ? 1000.0 : 1024.0;
    52     const NSInteger baseInt = [NSApp isOnSnowLeopardOrBetter] ? 1000 : 1024;
     52    const NSUInteger baseInt = [NSApp isOnSnowLeopardOrBetter] ? 1000 : 1024;
    5353   
    5454    if (size < baseInt)
     
    6969    else if (size < pow(baseInt, 3))
    7070    {
    71         convertedSize = size / pow(baseFloat, 2);
     71        convertedSize = size / powf(baseFloat, 2);
    7272        unit = NSLocalizedString(@"MB", "File size - megabytes");
    7373    }
    7474    else if (size < pow(baseInt, 4))
    7575    {
    76         convertedSize = size / pow(baseFloat, 3);
     76        convertedSize = size / powf(baseFloat, 3);
    7777        unit = NSLocalizedString(@"GB", "File size - gigabytes");
    7878    }
    7979    else
    8080    {
    81         convertedSize = size / pow(baseFloat, 4);
     81        convertedSize = size / powf(baseFloat, 4);
    8282        unit = NSLocalizedString(@"TB", "File size - terabytes");
    8383    }
Note: See TracChangeset for help on using the changeset viewer.