Position::Location.toDegrees() returns an array of objects

Former Member
Former Member
The API docs say it returns "An Array of the latitude and the longitude in degree format", and similar for .toRadians()

Looking at the return data it appears to return a 2-element array, but each element contains an object, rather than the number I'd expect. So this works:

var locs = info.position.toDegrees();
System.println("Latitude="+locs[0].toFloat());
System.println("Longitude="+locs[1].toFloat());


I think it would be helpful if the documentation was explicit about what the array was, and how to get at the lat/long numbers.