Have API return floats instead of ints for the values that are percentages computed by FTL

This commit is contained in:
DL6ER
2017-09-20 22:09:11 +02:00
parent d775eeb0bf
commit 874077107e
+7 -7
View File
@@ -179,11 +179,11 @@ if (isset($_GET['getForwardDestinations']) && $auth)
$tmp = explode(" ",$line);
if(count($tmp) == 4)
{
$forward_dest[$tmp[3]."|".$tmp[2]] = intval($tmp[1]);
$forward_dest[$tmp[3]."|".$tmp[2]] = floatval($tmp[1]);
}
else
{
$forward_dest[$tmp[2]] = intval($tmp[1]);
$forward_dest[$tmp[2]] = floatval($tmp[1]);
}
}
@@ -199,7 +199,7 @@ if (isset($_GET['getQueryTypes']) && $auth)
foreach($return as $ret)
{
$tmp = explode(": ",$ret);
$querytypes[$tmp[0]] = intval($tmp[1]);
$querytypes[$tmp[0]] = floatval($tmp[1]);
}
$result = array('querytypes' => $querytypes);
@@ -257,7 +257,7 @@ if (isset($_GET['overTimeDataForwards']) && $auth)
{
$tmp = explode(" ",$line);
for ($i=0; $i < count($tmp)-1; $i++) {
$over_time[intval($tmp[0])][$i] = intval($tmp[$i+1]);
$over_time[intval($tmp[0])][$i] = floatval($tmp[$i+1]);
}
}
$result = array('over_time' => $over_time);
@@ -274,11 +274,11 @@ if (isset($_GET['getForwardDestinationNames']) && $auth)
$tmp = explode(" ",$line);
if(count($tmp) == 4)
{
$forward_dest[$tmp[3]."|".$tmp[2]] = intval($tmp[1]);
$forward_dest[$tmp[3]."|".$tmp[2]] = floatval($tmp[1]);
}
else
{
$forward_dest[$tmp[2]] = intval($tmp[1]);
$forward_dest[$tmp[2]] = floatval($tmp[1]);
}
}
@@ -296,7 +296,7 @@ if (isset($_GET['overTimeDataQueryTypes']) && $auth)
{
$tmp = explode(" ",$line);
for ($i=0; $i < count($tmp)-1; $i++) {
$over_time[intval($tmp[0])][$i] = intval($tmp[$i+1]);
$over_time[intval($tmp[0])][$i] = floatval($tmp[$i+1]);
}
}
$result = array('over_time' => $over_time);