From 396d96132edffb3c6f6eeeff7edfdb0a38051328 Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Thu, 30 Jun 2016 13:47:50 +0300 Subject: [PATCH] [ios] Replaced custom bytes formatter with NSByteCountFormatter. --- iphone/Maps/Classes/Common.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/iphone/Maps/Classes/Common.h b/iphone/Maps/Classes/Common.h index 3d597537e5..5be6e4abb5 100644 --- a/iphone/Maps/Classes/Common.h +++ b/iphone/Maps/Classes/Common.h @@ -67,12 +67,7 @@ static uint64_t const MB = 1024 * 1024; static inline NSString * formattedSize(uint64_t size) { - NSString * sizeString; - if (size > MB) - sizeString = [NSString stringWithFormat:@"%llu %@", (size + 512 * KB) / MB, NSLocalizedString(@"mb", nil)]; - else - sizeString = [NSString stringWithFormat:@"%llu %@", (size + 1023) / KB, NSLocalizedString(@"kb", nil)]; - return [sizeString uppercaseString]; + return [NSByteCountFormatter stringFromByteCount:size countStyle:NSByteCountFormatterCountStyleFile]; } // Use only for screen dimensions CGFloat comparison