From 4bf41bd046a3c7b1d69159de34376b37749f4da4 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Mon, 26 Aug 2024 10:06:05 +0200 Subject: [PATCH] move intval() to the reg1testlib to make maxdistance function more generic --- application/libraries/Qra.php | 4 ++-- application/libraries/Reg1testformat.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/libraries/Qra.php b/application/libraries/Qra.php index cd7f3e008..4925d3d08 100644 --- a/application/libraries/Qra.php +++ b/application/libraries/Qra.php @@ -134,7 +134,7 @@ class Qra { * @param string $unit Unit of measurement * * @return object $maxdistanceqso Object of the QSO with the maximum distance - * @return integer $maxdistance Maximum distance + * @return float $maxdistance Maximum distance */ function getMaxDistanceQSO($mylocator, $qsos, $unit = "M") { @@ -162,7 +162,7 @@ class Qra { $result = []; $result['qso'] = $maxdistanceqso; - $result['distance'] = intval($maxdistance); + $result['distance'] = $maxdistance; //return findings return $result; diff --git a/application/libraries/Reg1testformat.php b/application/libraries/Reg1testformat.php index cea5f4d7b..b9aeeec7d 100644 --- a/application/libraries/Reg1testformat.php +++ b/application/libraries/Reg1testformat.php @@ -47,7 +47,7 @@ class Reg1testformat { //set QSO info for QSO with max distance only if we can determine it if($maxdistanceqso['qso'] != null){ - $edi_header .= "CODXC=" . strtoupper($maxdistanceqso['qso']->COL_CALL) . ";" . substr(strtoupper($maxdistanceqso['qso']->COL_GRIDSQUARE), 0, 6) . ";" . $maxdistanceqso['distance'] . "\r\n"; //Arguments describe the claimed ODX contact call, WWL and distance. + $edi_header .= "CODXC=" . strtoupper($maxdistanceqso['qso']->COL_CALL) . ";" . substr(strtoupper($maxdistanceqso['qso']->COL_GRIDSQUARE), 0, 6) . ";" . intval($maxdistanceqso['distance']) . "\r\n"; //Arguments describe the claimed ODX contact call, WWL and distance. }else{ $edi_header .= "CODXC=" . "\r\n"; //Arguments describe the claimed ODX contact call, WWL and distance. Leave empty. }