Skip to content

Commit 80689ee

Browse files
committed
Display formatted negative bytes properly
1 parent d4b6773 commit 80689ee

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Common.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,11 +504,11 @@ public static long GetTotalSize(TreeView sourceTree)
504504
// Formats bytes as a human-readable string
505505
public static string GetFormattedBytes(long bytes)
506506
{
507-
if (bytes >= 1000000000)
507+
if (Math.Abs(bytes) >= 1000000000)
508508
{
509509
return (Math.Truncate((double)bytes / 100000000) / 10).ToString("N1") + "GB";
510510
}
511-
else if (bytes >= 1000000)
511+
else if (Math.Abs(bytes) >= 1000000)
512512
{
513513
return (Math.Truncate((double)bytes / 100000) / 10).ToString("N1") + "MB";
514514
}

0 commit comments

Comments
 (0)