class LatitudeFormatter extends BaseLocationFormatter {

    @Override
    public Object formatCell(String val, String fmtString) throws ParseException
    {
        if (val == null || val.isEmpty())
        {
            return null;
        }

        CoordFormat fmt = CoordFormat.fromString(fmtString);
        double latitude = LatLonAltParser.parseLat(val, fmt);
        if (Double.isNaN(latitude))
        {
            return Constants.ERROR_LABEL;
        }
        if (fmt == CoordFormat.DECIMAL)
        {
            return String.valueOf(latitude);
        }
        if (fmt == CoordFormat.DDM)
        {
            return LatLonAlt.latToDdmString(latitude, 3);
        }
        return DegreesMinutesSeconds.getShortLabelString(latitude, 16, 3, 'N', 'S');
    }

    public  LatitudeFormatter(PreferencesRegistry registry);

}