[gnome-games] aisleriot: Correctly round the win percentage



commit 3a81ffe7f0fbf002c35abbb8ca6d077d734a0c9e
Author: Christian Persch <chpe gnome org>
Date:   Wed Jan 20 19:38:10 2010 +0100

    aisleriot: Correctly round the win percentage

 aisleriot/stats-dialog.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/aisleriot/stats-dialog.c b/aisleriot/stats-dialog.c
index d86cfca..1567797 100644
--- a/aisleriot/stats-dialog.c
+++ b/aisleriot/stats-dialog.c
@@ -235,7 +235,7 @@ aisleriot_stats_dialog_update (AisleriotStatsDialog *dialog,
      * "%" (U+0025 PERCENT SIGN) you do NOT need to escape it with another "%"!
      */
     g_snprintf (text, sizeof (text), _("%d%%"),
-                (100 * current_stats->wins) / current_stats->total);
+                (int) (100.0 * ((double) current_stats->wins) / ((double) current_stats->total) + 0.5));
     gtk_label_set_text (priv->percentage_label, text);
   } else
     /* For translators: N/A means "Not Applicable", use whatever



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]