Skip to content

Commit

Permalink
fix: round coordinates to 2DP instead of 1DP
Browse files Browse the repository at this point in the history
  • Loading branch information
eartharoid committed Nov 21, 2022
1 parent 21aed99 commit a94f7b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ for (const file of files) {
// convert & reduce precision
const decimalLatitude = (latitudeRef === 'N' ? 1 : -1) * piexif.GPSHelper.dmsRationalToDeg(latitude);
const decimalLongitude = (longitudeRef === 'E' ? 1 : -1) * piexif.GPSHelper.dmsRationalToDeg(longitude);
data.location_data = [decimalLatitude.toFixed(1), decimalLongitude.toFixed(1)].join(',');
data.location_data = [decimalLatitude.toFixed(2), decimalLongitude.toFixed(2)].join(',');

if (gpsCache.has(data.location_data)) {
data.location_name = gpsCache.get(data.location_data);
Expand Down

0 comments on commit a94f7b6

Please sign in to comment.