This commit is contained in:
guinux 2015-01-03 19:41:58 +01:00
parent 5f1c96e479
commit f9fc090707
1 changed files with 2 additions and 2 deletions

View File

@ -897,13 +897,13 @@ namespace Pamac {
} }
if (total_download > 0) { if (total_download > 0) {
fraction = (float) (xfered + already_downloaded) / total_download; fraction = (float) (xfered + already_downloaded) / total_download;
if (fraction > 0) if (fraction <= 1)
textbar = "%s/%s".printf (format_size (xfered + already_downloaded), format_size (total_download)); textbar = "%s/%s".printf (format_size (xfered + already_downloaded), format_size (total_download));
else else
textbar = "%s".printf (format_size (xfered + already_downloaded)); textbar = "%s".printf (format_size (xfered + already_downloaded));
} else { } else {
fraction = (float) xfered / total; fraction = (float) xfered / total;
if (fraction > 0) if (fraction <= 1)
textbar = "%s/%s".printf (format_size (xfered), format_size (total)); textbar = "%s/%s".printf (format_size (xfered), format_size (total));
else else
textbar = "%s".printf (format_size (xfered)); textbar = "%s".printf (format_size (xfered));