Skip to content

Commit

Permalink
Modified results and summary tables to show percentages to 2 decimal …
Browse files Browse the repository at this point in the history
…places instead of integers. sprintf("%01.2f"...

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@52 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Mar 17, 2003
1 parent 63cec21 commit 4bf4070
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions admin/statistics.php
Expand Up @@ -359,7 +359,7 @@
echo "\t<tr><td colspan='2' align='center' bgcolor='#666666'>$setfont<font color='#EEEEEE'>";
echo "<B>Your query returns $results record(s)!</b><br />\n\t\t";
echo "There are $total records in your survey. This query represents ";
$percent=sprintf("%02d", ($results/$total)*100);
$percent=sprintf("%01.2f", ($results/$total)*100);
echo "$percent% of your total results<br />\n\t\t<br />\n";
echo "\t\t<font size='1'>$query\n";
echo "\t</td></tr>\n";
Expand Down Expand Up @@ -505,7 +505,7 @@
if ($al[0] == "") {$fname="No Answer";} else {$fname="$al[1] ($al[0])";}
echo "\t<tr>\n\t\t<td width='50%' align='center' bgcolor='#666666'>$setfont<font color='#EEEEEE'>$fname\n\t\t</td>\n";
echo "\t\t<td width='25%' align='center' bgcolor='#666666'>$setfont<font color='#EEEEEE'>$row[0]";
if ($results > 0) {$vp=sprintf("%02d", ($row[0]/$results)*100);} else {$vp="No Records";}
if ($results > 0) {$vp=sprintf("%01.2f", ($row[0]/$results)*100);} else {$vp="No Records";}
echo "\t\t</td><td width='25%' align='center' bgcolor='#666666'>$setfont<font color='#EEEEEE'>$vp%";
echo "\t\t</td></tr>\n";
}
Expand Down

0 comments on commit 4bf4070

Please sign in to comment.