From bb7101482b21b44d886fc132d0821f90b242c158 Mon Sep 17 00:00:00 2001 From: Friedrich von Never Date: Thu, 8 Dec 2022 12:38:42 +0100 Subject: [PATCH] CompressArchiveCommand: fix issues with progress formatting - The progress now is actually reported. - The progress now uses current culture. --- src/CompressArchiveCommand.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CompressArchiveCommand.cs b/src/CompressArchiveCommand.cs index de521d9..19331de 100644 --- a/src/CompressArchiveCommand.cs +++ b/src/CompressArchiveCommand.cs @@ -203,7 +203,7 @@ protected override void EndProcessing() { // Update progress var percentComplete = numberOfAddedItems / (float)numberOfAdditions * 100f; - progressRecord.StatusDescription = string.Format(Messages.ProgressDisplay, "{percentComplete:0.0}"); + progressRecord.StatusDescription = string.Format(Messages.ProgressDisplay, $"{percentComplete:0.0}"); WriteProgress(progressRecord); if (ShouldProcess(target: entry.FileSystemInfo.FullName, action: Messages.Add)) @@ -219,7 +219,7 @@ protected override void EndProcessing() // Once all items in the archive are processed, show progress as 100% // This code is here and not in the loop because we want it to run even if there are no items to add to the archive - progressRecord.StatusDescription = string.Format(Messages.ProgressDisplay, "100.0"); + progressRecord.StatusDescription = string.Format(Messages.ProgressDisplay, $"{100.0:0.0}"); WriteProgress(progressRecord); } finally