Changeset

6562:2b5ced5ca31f

util.statistics: Return 0 as percentile if data out of range
author Matthew Wild <mwild1@gmail.com>
date Fri, 30 Jan 2015 14:21:51 +0000
parents 6559:0ef7ca5276a1
children 6563:f0a2bdfd0cea
files util/statistics.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/util/statistics.lua	Mon Jan 26 15:25:16 2015 +0100
+++ b/util/statistics.lua	Fri Jan 30 14:21:51 2015 +0000
@@ -8,7 +8,7 @@
 	local n = pc/100 * (length + 1);
 	local k, d = m_floor(n), n%1;
 	if k == 0 then
-		return arr[1];
+		return arr[1] or 0;
 	elseif k >= length then
 		return arr[length];
 	end