diff --git a/Sources/VLCLocalServerFolderListViewController.m b/Sources/VLCLocalServerFolderListViewController.m index 007798c763483a8e033827647c512d5f04c72079..e5d675d6a639af583058e4ef6a0df9dbe66a0c0b 100644 --- a/Sources/VLCLocalServerFolderListViewController.m +++ b/Sources/VLCLocalServerFolderListViewController.m @@ -206,7 +206,7 @@ else mediaSize = [mediaItem.size longLongValue]; - [cell setSubtitle: [NSString stringWithFormat:@"%0.2f MB (%@)", (float)(mediaSize / 1e6), mediaItem.duration]]; + [cell setSubtitle: [NSString stringWithFormat:@"%@ (%@)", [NSByteCountFormatter stringFromByteCount:mediaSize countStyle:NSByteCountFormatterCountStyleFile], mediaItem.duration]]; [cell setIsDirectory:NO]; cell.isDownloadable = YES; if (![mediaItem.albumArt isEqualToString:NULL]) { diff --git a/Sources/VLCPlaylistCollectionViewCell.m b/Sources/VLCPlaylistCollectionViewCell.m index ec6438a1c407fa080c945edffaa4a58f8712fa65..e142a3b113eb4348d6bda82b845e0bf30b8bdb19 100644 --- a/Sources/VLCPlaylistCollectionViewCell.m +++ b/Sources/VLCPlaylistCollectionViewCell.m @@ -218,7 +218,7 @@ VLCPlaylistViewController *delegate = (VLCPlaylistViewController*)self.collectionView.delegate; if (delegate.isEditing) - self.subtitleLabel.text = [NSString stringWithFormat:@"%@ — %i MB", [VLCTime timeWithNumber:[mediaFile duration]], (int)([mediaFile fileSizeInBytes] / 1e6)]; + self.subtitleLabel.text = [NSString stringWithFormat:@"%@ — %@", [VLCTime timeWithNumber:[mediaFile duration]], [NSByteCountFormatter stringFromByteCount:[mediaFile fileSizeInBytes] countStyle:NSByteCountFormatterCountStyleFile]]; else { self.subtitleLabel.text = [NSString stringWithFormat:@"%@", [VLCTime timeWithNumber:[mediaFile duration]]]; if (mediaFile.videoTrack) { diff --git a/Sources/VLCPlaylistTableViewCell.m b/Sources/VLCPlaylistTableViewCell.m index 5ff05905f50107d848a583619ad1ac0b09cf96b3..8d6f8f829ea15e5fae5c15288ec0c3dc44c811b3 100644 --- a/Sources/VLCPlaylistTableViewCell.m +++ b/Sources/VLCPlaylistTableViewCell.m @@ -224,7 +224,7 @@ self.titleLabel.text = mediaFile.title; if (self.isEditing) - self.subtitleLabel.text = [NSString stringWithFormat:@"%@ — %i MB", [VLCTime timeWithNumber:[mediaFile duration]], (int)([mediaFile fileSizeInBytes] / 1e6)]; + self.subtitleLabel.text = [NSString stringWithFormat:@"%@ — %@", [VLCTime timeWithNumber:[mediaFile duration]], [NSByteCountFormatter stringFromByteCount:[mediaFile fileSizeInBytes] countStyle:NSByteCountFormatterCountStyleFile]]; else { self.subtitleLabel.text = [NSString stringWithFormat:@"%@", [VLCTime timeWithNumber:[mediaFile duration]]]; if (mediaFile.videoTrack) {