From 07c710194e62b25099414c9e257a9aa22d98fca4 Mon Sep 17 00:00:00 2001 From: abarrau Date: Mon, 22 May 2023 20:35:21 +0200 Subject: [PATCH] Update Distances_model : change "round" to "ceil" I propose change "round" to "ceil" (Round fractions up). Because I work on an export plugin in EDI file (IARU REGTEST1), the rounding is systematically higher: "For the amateur bands up to 10 GHz inclusive, points will be scored on the basis of one point per kilometer, i.e. the calculated distance in kilometers will be truncated to an integer value and 1 km will be added. " (excerpt from VHF_Handbook_V9.01) --- application/models/Distances_model.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/models/Distances_model.php b/application/models/Distances_model.php index 642c0d8a..c704eeb7 100644 --- a/application/models/Distances_model.php +++ b/application/models/Distances_model.php @@ -256,13 +256,13 @@ class Distances_model extends CI_Model switch ($measurement_base) { case 'M': - return round(6371*$ca/1.609344); + return ceil(6371*$ca/1.609344); case 'K': - return round(6371*$ca); + return ceil(6371*$ca); case 'N': - return round(6371*$ca/1.852); + return ceil(6371*$ca/1.852); default: - return round(6371*$ca); + return ceil(6371*$ca); } } }