formatLongitude static method

String formatLongitude(
  1. num long
)

Formats a longitude long with the cardinal E (long >= 0) or W (long < 0, shown without the minus sign): 20°E, 20°W.

Implementation

static String formatLongitude(num long) {
  return long < 0 ? '${-long}°W' : '${long.abs()}°E';
}