From 456bdf3f3e6278621df20077a600018ef9514a61 Mon Sep 17 00:00:00 2001 From: Exodus4D Date: Tue, 17 Nov 2015 20:44:01 +0100 Subject: [PATCH] #65 fixed fixed trueSec rounding for low-sec/high-sec distinction --- app/main/data/mapper/ccpsystemsmapper.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/main/data/mapper/ccpsystemsmapper.php b/app/main/data/mapper/ccpsystemsmapper.php index e77efadb..4fe4e07e 100644 --- a/app/main/data/mapper/ccpsystemsmapper.php +++ b/app/main/data/mapper/ccpsystemsmapper.php @@ -72,10 +72,15 @@ class CcpSystemsMapper extends \RecursiveArrayIterator { if($trueSec <= 0){ $security = '0.0'; - }elseif($trueSec < 0.5){ - $security = 'L'; }else{ - $security = 'H'; + // more precise rounding required for "low sec" and "high sec" distinction + $trueSec = round($trueSec, 1); + + if($trueSec < 0.5){ + $security = 'L'; + }else{ + $security = 'H'; + } } }else{ $security = 'C' . $iterator['security'];