From 4fc5cff523b167b0f7b368eb007e6c6b10ce0994 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sat, 7 Nov 2009 22:57:37 +0000 Subject: [PATCH] use pow() instead of powf() --- macosx/NSStringAdditions.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/macosx/NSStringAdditions.m b/macosx/NSStringAdditions.m index d300ba967..16fdfd724 100644 --- a/macosx/NSStringAdditions.m +++ b/macosx/NSStringAdditions.m @@ -53,27 +53,27 @@ NSString * unit; if (size < pow(1024, 2)) { - convertedSize = size / 1024.0f; + convertedSize = size / 1024.0; unit = NSLocalizedString(@"KB", "File size - kilobytes"); } else if (size < pow(1024, 3)) { - convertedSize = size / powf(1024.0f, 2.0f); + convertedSize = size / (CGFloat)pow(1024, 2); unit = NSLocalizedString(@"MB", "File size - megabytes"); } else if (size < pow(1024, 4)) { - convertedSize = size / powf(1024.0f, 3.0f); + convertedSize = size / (CGFloat)pow(1024, 3); unit = NSLocalizedString(@"GB", "File size - gigabytes"); } else { - convertedSize = size / powf(1024.0f, 4.0f); + convertedSize = size / (CGFloat)pow(1024, 4); unit = NSLocalizedString(@"TB", "File size - terabytes"); } //attempt to have minimum of 3 digits with at least 1 decimal - return convertedSize <= 9.995f ? [NSString localizedStringWithFormat: @"%.2f %@", convertedSize, unit] + return convertedSize <= 9.995 ? [NSString localizedStringWithFormat: @"%.2f %@", convertedSize, unit] : [NSString localizedStringWithFormat: @"%.1f %@", convertedSize, unit]; }