From 563022c4cd934738a5663930296add8eeb1be753 Mon Sep 17 00:00:00 2001 From: "Janus B. Kristensen" Date: Thu, 6 Jan 2005 18:48:07 +0000 Subject: [PATCH] round scores and ratings in forum to avoid stuff like 2.99999999999 svn path=/trunk/boinc/; revision=5004 --- checkin_notes | 5 ++++- html/inc/forum.inc | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/checkin_notes b/checkin_notes index 207e0f026e..d16d021a99 100755 --- a/checkin_notes +++ b/checkin_notes @@ -22102,7 +22102,10 @@ Janus 6 Jan 2005 column: ALTER TABLE `forum_preferences` ADD `ignorelist` VARCHAR( 254 ) NOT NULL ; - Added thread name to page title in forums (from Athlonrob) + + - Added thread name to page title in forums (from Athlonrob) + - Round scores and ratings in forum to avoid a rating of + for instance 2.999999999 /html/user edit_forum_preferences_form.php diff --git a/html/inc/forum.inc b/html/inc/forum.inc index 2eccbff54e..baaa05c35b 100644 --- a/html/inc/forum.inc +++ b/html/inc/forum.inc @@ -588,7 +588,7 @@ function show_post($post, $thread, $logged_in_user, $n, $controls=FORUM_CONTROLS } else if ($controls == HELPDESK_CONTROLS && !$separate) { echo " / Score: ", ($post->score * $post->votes), ""; } else { - echo " / Rating: ", intval(($post->score * $post->votes)+0.01), " - rate: id."&choice=p\">+ / id."&choice=n\">-"; + echo " / Rating: ", round(intval(($post->score * $post->votes)+0.01),0), " - rate: id."&choice=p\">+ / id."&choice=n\">-"; } if ($controls == FORUM_CONTROLS) {