NeoGPS

I am running the NMEAlocDMS example sketch of NeoGPS.
This runs great and the Serial Monitor output is:

25 51' 22.218" S 028 10' 45.690" E
25 51' 22.218" S 028 10' 45.690" E
25 51' 22.218" S 028 10' 45.690" E

The above is: DD MM SS.sss
Which is Degrees/Minutes/Seconds.

How can I convert the Seconds to minutes so that I have DD MM.mmmm

The above coordinate (Lat) would then be: 2551.3073

Please post the complete sketch so that we can see what data types are being used

How would you do the conversion using pencil and paper ?

UKHeliBob:
Please post the complete sketch so that we can see what data types are being used

How would you do the conversion using pencil and paper ?

I would like to do the calculation in the library, if possible.

The full sketch

#include <Arduino.h>
#include <NMEAGPS.h>

//======================================================================
//  Program: NMEAlocDMS.ino
//
//  Description:  This program only parses an RMC sentence for the lat/lon.
//
//  Prerequisites:
//     1) NMEA.ino works with your device (correct TX/RX pins and baud rate)
//     2) The RMC sentence has been enabled.
//     3) Your device sends an RMC sentence (e.g., $GPRMC).
//
//  Serial is for trace output to the Serial Monitor window.
//
//  License:
//    Copyright (C) 2014-2017, SlashDevin
//
//    This file is part of NeoGPS
//
//    NeoGPS is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    NeoGPS is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with NeoGPS.  If not, see <http://www.gnu.org/licenses/>.
//
//======================================================================

#include <GPSport.h>

//------------------------------------------------------------
// Check that the config files are set up properly

#if !defined( NMEAGPS_PARSE_RMC )
  #error You must uncomment NMEAGPS_PARSE_RMC in NMEAGPS_cfg.h!
#endif

#if !defined( GPS_FIX_LOCATION_DMS )
  #error You must uncomment GPS_FIX_LOCATION_DMS in GPSfix_cfg.h!
#endif

#ifdef NMEAGPS_INTERRUPT_PROCESSING
  #error You must *NOT* define NMEAGPS_INTERRUPT_PROCESSING in NMEAGPS_cfg.h!
#endif

//------------------------------------------------------------

static NMEAGPS  gps; // This parses the GPS characters

static void doSomeWork( const gps_fix & fix );
static void doSomeWork( const gps_fix & fix )
{
  //  This is the best place to do your time-consuming work, right after
  //     the RMC sentence was received.  If you do anything in "loop()",
  //     you could cause GPS characters to be lost, and you will not
  //     get a good lat/lon.
  //  For this example, we just print the lat/lon.  If you print too much,
  //     this routine will not get back to "loop()" in time to process
  //     the next set of GPS data.

  if (fix.valid.location) {

    DEBUG_PORT << fix.latitudeDMS;
    DEBUG_PORT.print( fix.latitudeDMS.NS() );
    DEBUG_PORT.write( ' ' );
    if (fix.longitudeDMS.degrees < 100)
      DEBUG_PORT.write( '0' );
    DEBUG_PORT << fix.longitudeDMS;
    DEBUG_PORT.print( fix.longitudeDMS.EW() );

  } else {
    // No valid location data yet!
    DEBUG_PORT.print( '?' );
  }

  DEBUG_PORT.println();

} // doSomeWork

//------------------------------------

static void GPSloop();
static void GPSloop()
{  
  while (gps.available( gpsPort ))
    doSomeWork( gps.read() );

} // GPSloop
  
//--------------------------

void setup()
{
  pinMode(5, OUTPUT); // GPS PIN
  digitalWrite(5, LOW);//GPS ON
  delay(100);
  
  DEBUG_PORT.begin(9600);
  while (!DEBUG_PORT)
    ;

  DEBUG_PORT.print( F("NMEAlocDMS.INO: started\n") );
  DEBUG_PORT.println( F("Looking for GPS device on " GPS_PORT_NAME) );
  DEBUG_PORT.flush();

  gpsPort.begin(9600);
}

//--------------------------

void loop()
{
  GPSloop();
}

(deleted)

How can I convert the Seconds to minutes so that I have DD MM.mmmm

That is the format of the GPS output, so skip the NeoGPS step and read it directly.