Avoid precision loss on GPS fixes

It appears that the Qt documentation might be incorrect. It claims that
the precision value is digits after the decimal point, but we have seen
examples where the values posted to the server appear to have a total of 6
digits, including the digits ahead of the decimal point.

Upping this to 9 shouldn't hurt if Qt gets fixed, but should work around
the issue reported by a tester.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2016-01-22 06:41:43 -08:00
parent 260cd14a2b
commit c2eeda44e6

View file

@ -506,8 +506,8 @@ void GpsLocation::uploadToServer()
data.addQueryItem("login", prefs.userid);
data.addQueryItem("dive_date", dt.toString("yyyy-MM-dd"));
data.addQueryItem("dive_time", dt.toString("hh:mm"));
data.addQueryItem("dive_latitude", QString::number(gt.latitude.udeg / 1000000.0, 'f', 6));
data.addQueryItem("dive_longitude", QString::number(gt.longitude.udeg / 1000000.0, 'f', 6));
data.addQueryItem("dive_latitude", QString::number(gt.latitude.udeg / 1000000.0, 'f', 9));
data.addQueryItem("dive_longitude", QString::number(gt.longitude.udeg / 1000000.0, 'f', 9));
if (gt.name.isEmpty())
gt.name = "Auto-created dive";
data.addQueryItem("dive_name", gt.name);