diff options
author | Scott Murray <scott.murray@konsulko.com> | 2022-12-30 02:37:11 -0500 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2022-12-30 07:47:22 +0000 |
commit | 888eca5ba20672448624a418ebad573dd4d640e6 (patch) | |
tree | 971e4ef00268ebcbeb2341b59849c640df61b59e | |
parent | 5bf2b9d30ccea0f5468b22abedbe1629691eab15 (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.cpp | 2 |
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 { |