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

This commit is contained in:
Mitchell Livingston
2010-11-14 20:26:58 +00:00
parent 69fcecce1a
commit c8ada6126c
5 changed files with 16 additions and 17 deletions

View File

@@ -503,11 +503,7 @@ tr_session * fHandle;
if (exists)
{
NSNumberFormatter * numberFormatter = [[[NSNumberFormatter alloc] init] autorelease];
[numberFormatter setNumberStyle: NSNumberFormatterDecimalStyle];
[numberFormatter setMaximumFractionDigits: 0];
NSString * countString = [numberFormatter stringFromNumber: [NSNumber numberWithInt: tr_blocklistGetRuleCount(fHandle)]];
NSString * countString = [NSString formattedUInteger: tr_blocklistGetRuleCount(fHandle)];
[fBlocklistMessageField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%@ IP address rules in list",
"Prefs -> blocklist -> message"), countString]];
}