[gnome-maps] sendToDialog: Limit precision of coordinates



commit 5e9fd0fe1ce2f0edf54cacb45b58c0dd321d602a
Author: James Westman <james flyingpimonster net>
Date:   Mon Nov 9 22:14:07 2020 -0600

    sendToDialog: Limit precision of coordinates
    
    Limit decimal precision of coordinates in the send to dialog to 5 decimal
    places, like elsewhere in Maps.
    
    See also https://xkcd.com/2170.

 src/sendToDialog.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/sendToDialog.js b/src/sendToDialog.js
index 9c3e9632..50198014 100644
--- a/src/sendToDialog.js
+++ b/src/sendToDialog.js
@@ -158,8 +158,8 @@ var SendToDialog = GObject.registerClass({
             lines.push(details);
         }
 
-        lines.push('%f, %f'.format(this._location.latitude,
-                                   this._location.longitude));
+        lines.push('%f, %f'.format(this._location.latitude.toFixed(5),
+                                   this._location.longitude.toFixed(5)));
 
         return lines.join('\n');
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]