From 4f69b944b1bcafe4453db60bf179bed130cc8348 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sun, 14 Nov 2010 21:51:56 +0000 Subject: [PATCH] use the number formatter when displaying bytes --- macosx/InfoWindowController.m | 8 ++++---- macosx/StatsWindowController.m | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index 2a5a571f1..f7a36649e 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -433,8 +433,8 @@ typedef enum [fBasicInfoField setStringValue: [NSString stringWithFormat: @"%@, %@", fileString, [NSString stringWithFormat: NSLocalizedString(@"%@ total", "Inspector -> selected torrents"), [NSString stringForFileSize: size]]]]; - [fBasicInfoField setToolTip: [NSString stringWithFormat: NSLocalizedString(@"%llu bytes", - "Inspector -> selected torrents"), size]]; + [fBasicInfoField setToolTip: [NSString stringWithFormat: NSLocalizedString(@"%@ bytes", + "Inspector -> selected torrents"), [NSString formattedUInteger: size]]]; } else { @@ -485,8 +485,8 @@ typedef enum basicString = [NSString stringWithFormat: @"%@, %@", fileString, basicString]; } [fBasicInfoField setStringValue: basicString]; - [fBasicInfoField setToolTip: [NSString stringWithFormat: NSLocalizedString(@"%llu bytes", "Inspector -> selected torrents"), - [torrent size]]]; + [fBasicInfoField setToolTip: [NSString stringWithFormat: NSLocalizedString(@"%@ bytes", "Inspector -> selected torrents"), + [NSString formattedUInteger: [torrent size]]]]; } else { diff --git a/macosx/StatsWindowController.m b/macosx/StatsWindowController.m index 3b704b16b..bda752a29 100644 --- a/macosx/StatsWindowController.m +++ b/macosx/StatsWindowController.m @@ -167,20 +167,20 @@ tr_session * fLib; tr_sessionGetStats(fLib, &statsSession); [fUploadedField setStringValue: [NSString stringForFileSize: statsSession.uploadedBytes]]; - [fUploadedField setToolTip: [NSString stringWithFormat: NSLocalizedString(@"%llu bytes", "stats -> bytes"), - statsSession.uploadedBytes]]; + [fUploadedField setToolTip: [NSString stringWithFormat: NSLocalizedString(@"%@ bytes", "stats -> bytes"), + [NSString formattedUInteger: statsSession.uploadedBytes]]]; [fUploadedAllField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%@ total", "stats total"), [NSString stringForFileSize: statsAll.uploadedBytes]]]; - [fUploadedAllField setToolTip: [NSString stringWithFormat: NSLocalizedString(@"%llu bytes", "stats -> bytes"), - statsAll.uploadedBytes]]; + [fUploadedAllField setToolTip: [NSString stringWithFormat: NSLocalizedString(@"%@ bytes", "stats -> bytes"), + [NSString formattedUInteger: statsAll.uploadedBytes]]]; [fDownloadedField setStringValue: [NSString stringForFileSize: statsSession.downloadedBytes]]; - [fDownloadedField setToolTip: [NSString stringWithFormat: NSLocalizedString(@"%llu bytes", "stats -> bytes"), - statsSession.downloadedBytes]]; + [fDownloadedField setToolTip: [NSString stringWithFormat: NSLocalizedString(@"%@ bytes", "stats -> bytes"), + [NSString formattedUInteger: statsSession.downloadedBytes]]]; [fDownloadedAllField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%@ total", "stats total"), [NSString stringForFileSize: statsAll.downloadedBytes]]]; - [fDownloadedAllField setToolTip: [NSString stringWithFormat: NSLocalizedString(@"%llu bytes", "stats -> bytes"), - statsAll.downloadedBytes]]; + [fDownloadedAllField setToolTip: [NSString stringWithFormat: NSLocalizedString(@"%@ bytes", "stats -> bytes"), + [NSString formattedUInteger: statsAll.downloadedBytes]]]; [fRatioField setStringValue: [NSString stringForRatio: statsSession.ratio]];