mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Don't drop precision from floating point GP coordinates
Using '%f' limits the precision to 6 decimals, which may well be perfectly ok. But at least in theory you *could* have higher precision, and gps units will report it, so don't mindlessly limit us to what %f shows. This arbitrarily uses '%.12g' instead. %g will drop excess zeroes at the end, so it actually results in the same (or shorter) ascii representation unless you have the extra precision. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
4c6f142e85
commit
0f9d1757a4
1 changed files with 1 additions and 1 deletions
|
@ -162,7 +162,7 @@ static void show_location(FILE *f, struct dive *dive)
|
|||
*/
|
||||
if (latitude || longitude) {
|
||||
int len = snprintf(buffer, sizeof(buffer)-4,
|
||||
" <location gps='%f %f'>",
|
||||
" <location gps='%.12g %.12g'>",
|
||||
latitude, longitude);
|
||||
if (!dive->location) {
|
||||
memcpy(&buffer[len-1], "/>\n", 4);
|
||||
|
|
Loading…
Reference in a new issue