Ignore:
Timestamp:
Nov 14, 2010, 8:26:58 PM (12 years ago)
Author:
livings124
Message:

add a string function to format an NSUInteger as a formatted string

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r11416 r11417  
    17861786- (void) setBottomCountText: (BOOL) filtering
    17871787{
    1788     NSNumberFormatter * numberFormatter = [[[NSNumberFormatter alloc] init] autorelease];
    1789     [numberFormatter setNumberStyle: NSNumberFormatterDecimalStyle];
    1790     [numberFormatter setMaximumFractionDigits: 0];
    1791    
    17921788    NSString * totalTorrentsString;
    17931789    NSUInteger totalCount = [fTorrents count];
    17941790    if (totalCount != 1)
    17951791        totalTorrentsString = [NSString stringWithFormat: NSLocalizedString(@"%@ transfers", "Status bar transfer count"),
    1796                                 [numberFormatter stringFromNumber: [NSNumber numberWithUnsignedInteger: totalCount]]];
     1792                                [NSString formattedUInteger: totalCount]];
    17971793    else
    17981794        totalTorrentsString = NSLocalizedString(@"1 transfer", "Status bar transfer count");
     
    18051801       
    18061802        totalTorrentsString = [NSString stringWithFormat: NSLocalizedString(@"%@ of %@", "Status bar transfer count"),
    1807                                 [numberFormatter stringFromNumber: [NSNumber numberWithUnsignedInteger: count]],
    1808                                 totalTorrentsString];
     1803                                [NSString formattedUInteger: count], totalTorrentsString];
    18091804    }
    18101805   
Note: See TracChangeset for help on using the changeset viewer.