From 66a7a1f220e6164a28ed498d7ae485c290cacff6 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Wed, 10 Oct 2007 23:17:44 +0000 Subject: [PATCH] display terabytes for file size when applicable --- macosx/NSStringAdditions.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/macosx/NSStringAdditions.m b/macosx/NSStringAdditions.m index 83ad57e22..4daff9033 100644 --- a/macosx/NSStringAdditions.m +++ b/macosx/NSStringAdditions.m @@ -54,11 +54,16 @@ convertedSize = size / 1048576.0; unit = NSLocalizedString(@"MB", "File size"); } - else + else if (size < 1099511627776.0) { convertedSize = size / 1073741824.0; unit = NSLocalizedString(@"GB", "File size"); } + else + { + convertedSize = size / 1099511627776.0; + unit = NSLocalizedString(@"TB", "File size"); + } //attempt to have minimum of 3 digits with at least 1 decimal return [NSString stringWithFormat: convertedSize < 10.0 ? @"%.2f %@" : @"%.1f %@", convertedSize, unit];