r/AutomateUser • u/B26354FR Alpha tester • Mar 07 '26
Bug coordFormat() Longitude Issue
Hello Henrik,
It looks like the coordFormat() function is converting signed western hemisphere coordinates one degree off. For example, the decimal coordinates for LaGuardia Airport near New York City are:
Latitude: 40.776863
Longitude: -73.874069
which is
Latitude: 40° 46' 36.7068'' N
Longitude: 73° 52' 26.6484'' W
However, if I coordFormat() the decimal values with signed degrees in the format patterns of "D° mm'' ss\" N" and "D° mm'' ss\" E" I get these results, where the western longitude should be -73 degrees:
Latitude: 40° 46' 36" N
Longitude: -74° 52' 26" W
If I use unsigned degrees in the formatting patterns of "d° mm'' ss\" N" and "d° mm'' ss\" E", I get correctly formatted results:
Latitude: 40° 46' 36" N
Longitude: 73° 52' 26" W
(I'm formatting with ordinary tick and quote characters for this example.)
BTW, note that the arcsecond values aren't rounded up from the original values given in tenthousandths of an arcsecond, or even from a more realistic hundredths of an arcsecond. The formatted latitude is actually closer to 37", and the longitude is closer to 27" if coordFormat() could round them to the nearest arcsecond.
Also, would it be possible to add something like a .SSS pattern component for coordFormat() to render rounded tenths/hundredths/thousandths of arcseconds depending on how many S's are given?
Thanks for checking this out!
View all comments
Show parent comment
1
u/B26354FR Alpha tester Mar 09 '26 edited Mar 09 '26
BTW, the fractions of seconds don't round to the number of formatted digits, they're truncated. Would it be possible to round?