1
0
mirror of https://github.com/moparisthebest/pacman synced 2025-02-28 17:31:52 -05:00

Remove rounding on package size totals

We print the total to two decimal places, so there is no real need for
rounding of the values. Remove the rounding and switch all output to two
decimal places.

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2007-10-16 08:41:37 -05:00
parent 128b288ca7
commit 619bf56e66

View File

@ -368,8 +368,8 @@ void display_targets(const alpm_list_t *syncpkgs)
/* Convert byte size to MB */
mbdispsize = dispsize / (1024.0 * 1024.0);
asprintf(&str, "%s-%s [%.1f MB]", alpm_pkg_get_name(pkg),
alpm_pkg_get_version(pkg), (mbdispsize < 0.1 ? 0.1 : mbdispsize));
asprintf(&str, "%s-%s [%.2f MB]", alpm_pkg_get_name(pkg),
alpm_pkg_get_version(pkg), mbdispsize);
} else {
asprintf(&str, "%s-%s", alpm_pkg_get_name(pkg),
alpm_pkg_get_version(pkg));
@ -390,28 +390,16 @@ void display_targets(const alpm_list_t *syncpkgs)
printf("\n");
FREELIST(to_remove);
/* round up if size is really small */
if(mbrsize < 0.1) {
mbrsize = 0.1;
}
printf(_("Total Removed Size: %.2f MB\n"), mbrsize);
}
list_display(_("Targets:"), targets);
printf("\n");
/* round up if size is really small */
if(mbsize < 0.1) {
mbsize = 0.1;
}
printf(_("Total Package Size: %.2f MB\n"), mbsize);
/* TODO because all pkgs don't include isize, this is a crude hack */
if(mbisize > mbsize) {
/*round up if size is really small */
if(mbisize < 0.1) {
mbisize = 0.1;
}
printf(_("Total Installed Size: %.2f MB\n"), mbisize);
}