Show 0km instead of blank (same as QSO view)

This commit is contained in:
phl0
2026-01-22 22:26:49 +01:00
parent 846b86da38
commit 2ccdfc49fa
2 changed files with 4 additions and 4 deletions

View File

@@ -131,7 +131,7 @@ function getBearing($grid = '') {
}
function getDistance($distance) {
if (($distance ?? 0) == 0) return '';
if ($distance === null) return '';
$ci =& get_instance();
if ($ci->session->userdata('user_measurement_base') == NULL) {

View File

@@ -88,7 +88,7 @@ class QSO
private string $orbit;
private string $stationpower;
private float $distance;
private ?string $distance;
private string $antennaazimuth;
private string $antennaelevation;
@@ -289,7 +289,7 @@ class QSO
$this->profilename = $data['station_profile_name'] ?? '';
$this->stationpower = $data['COL_TX_PWR'] ?? '';
$this->distance = (float)$data['COL_DISTANCE'] ?? 0;
$this->distance = $data['COL_DISTANCE'];
$this->antennaazimuth = $data['COL_ANT_AZ'] ?? '';
$this->antennaelevation = $data['COL_ANT_EL'] ?? '';
@@ -1315,7 +1315,7 @@ class QSO
private function getFormattedDistance(): string
{
if ($this->distance == 0) return '';
if ($this->distance === null) return '';
switch ($this->measurement_base) {
case 'M':