Which GPS library are you using?
You state "The data is retrived via int latitude = GPS.latitude; in the format: 4042.6142"
The type int cannot store a number with decimal places (i.e. the "4042.6142") without truncating it. You would need to use double however I would try to use a character array instead and look to use the strtok function to parse the string.
Try to stay away from the string class as past posts have shown problems with memory usage and bugs. If we can look up ythe output type(s) of the GPS library that you are using it will be easier to help.
"Parsing" implies that you have a string. A float (not a double; the value is defined as a float) is not a string.
You can truncate the float as an int to get the whole part (4042). You can use division by, and modulo, 100 to get the degrees and minutes (40 and 42). Subtract the whole part from the float to get the fractional part (0.6142). Adding the minutes and fractional part will give you the parts that you want.
AVR based Arduinos don't have "double." Which has given people who are doing stuff with gps no end of trouble, since apparently many of the calculations used really NEED the extra precision of "double." (which is "interesting"...)
Which has given people who are doing stuff with gps no end of trouble, since apparently many of the calculations used really NEED the extra precision of "double."
I have just received one of these: Micromega: uM-FPU64 (which I haven't connected up yet).
It does the NMEA parsing and geodetic (Haversine and crosstrack error) calculations to 64 bit precision, offloading the heavy lifting from the arduino.