From d0476b7a7eca48453fe9bde60e2991f78df252d8 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Tue, 8 Sep 2009 11:36:00 +0000
Subject: [PATCH] statistics_Graph_GoogleCharts: round->intval, to ensure that
 the values are rounded down.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1748 44740490-163a-0410-bde0-09ae8108e29a
---
 modules/statistics/lib/Graph/GoogleCharts.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/statistics/lib/Graph/GoogleCharts.php b/modules/statistics/lib/Graph/GoogleCharts.php
index 73143687e..0bfb9d09b 100644
--- a/modules/statistics/lib/Graph/GoogleCharts.php
+++ b/modules/statistics/lib/Graph/GoogleCharts.php
@@ -45,8 +45,8 @@ class sspmod_statistics_Graph_GoogleCharts {
 		
 		foreach($values as $k => $v){ 
 			if($v >= 0 && $v <= 100){ 
-				$first = substr($extended_table, round( ($delta*$v/100) / $size),1); 
-				$second = substr($extended_table, round( ($delta*$v/100) % $size), 1); 
+				$first = substr($extended_table, intval( ($delta*$v/100) / $size),1);
+				$second = substr($extended_table, intval( ($delta*$v/100) % $size), 1);
 				$chardata .= "$first$second"; 
 				#echo '<p>encoding ' . $v . ' to ' . $first . ' ' . $second . '';
 			} else { 
-- 
GitLab