#3298 Move percentage string formatting into its own method, and don't append .00 to 100%

This commit is contained in:
Mitchell Livingston
2010-06-24 00:00:43 +00:00
parent 075169b409
commit 2980120847
7 changed files with 36 additions and 28 deletions

View File

@@ -124,12 +124,12 @@
[fStateField setStringValue: [torrent stateString]];
NSString * progressString = [NSString localizedStringWithFormat: @"%.2f%%", tr_truncd(100.0 * [torrent progress], 2)];
NSString * progressString = [NSString percentString: [torrent progress] longDecimals: YES];
if ([torrent isFolder])
{
NSString * progressSelectedString = [NSString localizedStringWithFormat:
NSLocalizedString(@"%.2f%% selected", "Inspector -> Activity tab -> progress"),
tr_truncd(100.0 * [torrent progressDone], 2)];
NSString * progressSelectedString = [NSString stringWithFormat:
NSLocalizedString(@"%@ selected", "Inspector -> Activity tab -> progress"),
[NSString percentString: [torrent progressDone] longDecimals: YES]];
progressString = [progressString stringByAppendingFormat: @" (%@)", progressSelectedString];
}
[fProgressField setStringValue: progressString];