summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2022-12-30 02:37:11 -0500
committerScott Murray <scott.murray@konsulko.com>2022-12-30 07:47:22 +0000
commit888eca5ba20672448624a418ebad573dd4d640e6 (patch)
tree971e4ef00268ebcbeb2341b59849c640df61b59e
parent5bf2b9d30ccea0f5468b22abedbe1629691eab15 (diff)
vehicle-signals: Increase double value precision
The code for double values for VSS signals was using the default Qt double to string conversion, which defaults to a max of 6 decimal places, explicitly format with 9 so that latitude and longtitude values for the navigation related signals do not get truncated. Bug-AGL: SPEC-4662 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I49d23c4224c41f33687c20cdbd21f4cbb538c52d
-rw-r--r--vehicle-signals/vehiclesignals.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/vehicle-signals/vehiclesignals.cpp b/vehicle-signals/vehiclesignals.cpp
index f3db521..d6cf8eb 100644
--- a/vehicle-signals/vehiclesignals.cpp
+++ b/vehicle-signals/vehiclesignals.cpp
@@ -337,7 +337,7 @@ bool VehicleSignals::parseData(const QJsonObject &response, QString &path, QStri
} else if (dp["value"].isString()) {
value = dp["value"].toString();
} else if (dp["value"].isDouble()) {
- value.setNum(dp["value"].toDouble());
+ value = QString::number(dp["value"].toDouble(), 'f', 9);
} else if (dp["value"].isBool()) {
value = dp["value"].toBool() ? "true" : "false";
} else {