summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-10-16 08:41:37 -0500
committerDan McGee <dan@archlinux.org>2007-10-16 08:41:37 -0500
commit619bf56e6613333f319fb1add22fa989060e208d (patch)
tree0649a487b76ef2d8ad7cecd3526a459bdf673638
parent128b288ca7f396d3cbb6c9620807075274bdbe8e (diff)
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>
-rw-r--r--src/pacman/util.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/pacman/util.c b/src/pacman/util.c
index 2c007536..48f3f1eb 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -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);
}