I am attempting to convert DD to DMS for a feature layer (WKID 4326) that provides a global lat/lon grid. The grid displays labels in DD.ddd format. I have written the follow Arcade expression which works wonders with one exception: I am getting values of 60", which doesn't exist. For instance, 125° 15' 60" instead of 125° 16' 00". It is only on about half the labels and isn't consistent as to how often it appears at various scales/areas.
Any ideas as to what I need to alter in the expression to correct this issue?
(I am doing this on a disconnected Enterprise system, so I have fat fingered in the expression here. Any typos are just here as it works as described above in production.)
if (dd < 0) {
var quad = '-';
} else {
var quad = '';
}
var degrees = Floor(Abs(dd), 0);
var mm = (Abs(dd) - degrees) * 60;
var minutes = Floor(mm);
var seconds = (mm - minutes) * 60;
var dms = quad + Text(degrees, "###") + "° " + Text(minutes, "00") + "' " + Text(seconds, "00") + '" ';
return dms;
Thanks!