From e37848ca60c3883f87816a1254e123ad0f583280 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sat, 8 Jan 2011 17:19:17 +0000 Subject: [PATCH] use a float instead of a double for file unit size --- macosx/NSStringAdditions.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macosx/NSStringAdditions.m b/macosx/NSStringAdditions.m index f3641183d..546116608 100644 --- a/macosx/NSStringAdditions.m +++ b/macosx/NSStringAdditions.m @@ -179,7 +179,7 @@ + (NSString *) stringForFileSize: (uint64_t) size showUnitUnless: (NSString *) notAllowedUnit unitsUsed: (NSString **) unitUsed { - const double baseFloat = [NSApp isOnSnowLeopardOrBetter] ? 1000.0 : 1024.0; + const float baseFloat = [NSApp isOnSnowLeopardOrBetter] ? 1000.0 : 1024.0; const NSUInteger baseInt = [NSApp isOnSnowLeopardOrBetter] ? 1000 : 1024; double convertedSize; @@ -216,7 +216,7 @@ [numberFormatter setMinimumFractionDigits: 0]; [numberFormatter setMaximumFractionDigits: decimals]; - NSString * fileSizeString = [numberFormatter stringFromNumber: [NSNumber numberWithDouble: convertedSize]]; + NSString * fileSizeString = [numberFormatter stringFromNumber: [NSNumber numberWithFloat: convertedSize]]; if (!notAllowedUnit || ![unit isEqualToString: notAllowedUnit]) fileSizeString = [fileSizeString stringByAppendingFormat: @" %@", unit];