[gnome-control-center] Round percentage properly
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] Round percentage properly
- Date: Sat, 5 Jan 2013 16:07:22 +0000 (UTC)
commit 4f7e573d2dc3d455fe3f030caf2c00d184277d31
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Jan 5 11:07:21 2013 -0500
Round percentage properly
We don't want to display 'fully charged - 99%'.
https://bugzilla.gnome.org/show_bug.cgi?id=691188
panels/power/cc-power-panel.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/panels/power/cc-power-panel.c b/panels/power/cc-power-panel.c
index feb8e52..c361197 100644
--- a/panels/power/cc-power-panel.c
+++ b/panels/power/cc-power-panel.c
@@ -338,7 +338,7 @@ set_primary (CcPowerPanel *panel, UpDevice *device)
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
gtk_box_pack_start (GTK_BOX (box2), label, TRUE, TRUE, 0);
- s = g_strdup_printf ("%d%%", (int)percentage);
+ s = g_strdup_printf ("%d%%", (int)(percentage + 0.5));
label = gtk_label_new (s);
g_free (s);
gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]