Yes, use dtostrf.
#include <baudot.h>
#include <RTTY.h>
#include <NMEAGPS.h>
NMEAGPS gps; // Define the object that parses GPS characters into...
gps_fix fix; // ... the structure containing all those field values.
#define GPS_BAUD 9600 // GPS module baud rate. GP3906 defaults to 9600.
#define gpsPort Serial1
// Define the serial monitor port. On the Uno and Leonardo this is 'Serial'
// on other boards this may be 'SerialUSB'
#define SerialMonitor Serial
void setup()
{
RTTY.attach(12);
SerialMonitor.begin(9600);
gpsPort.begin(GPS_BAUD);
}
void loop()
{
if (gps.available( gpsPort )) {
fix = gps.read();
char buffer[16];
RTTY.tx("alt: ");
buffer[0] = '\0'; // empty the string
if (fix.valid.altitude)
dtostrf( fix.altitude_ft(), 1, 2, buffer );
RTTY.tx( buffer );
RTTY.tx(" ");
RTTY.tx("lat: ");
buffer[0] = '\0'; // empty the string
if (fix.valid.location)
dtostrf( fix.latitude(), 1, 6, buffer );
RTTY.tx( buffer );
RTTY.tx(" ");
RTTY.tx("long: ");
buffer[0] = '\0'; // empty the string
if (fix.valid.location)
dtostrf( fix.longitude(), 1, 6, buffer );
RTTY.tx( buffer );
RTTY.tx(" ");
printGPSInfo();
}
}
void printGPSInfo()
{
// print position, altitude, speed
SerialMonitor.print( F("Location: ") );
if (fix.valid.location) {
SerialMonitor.print( fix.latitude(), 6 );
SerialMonitor.print( ',' );
SerialMonitor.print( fix.longitude(), 6 );
}
SerialMonitor.print( F(", Altitude: ") );
if (fix.valid.altitude)
SerialMonitor.print( fix.altitude() );
SerialMonitor.println();
}
If you want to try that NeoGPS version of your sketch, you can get the NeoGPS library from the Arduino Library Manager, under the menu Sketch-> Include Library-> Manage Libraries.
Of course, we still don't know which RTTY library you are using. None of the libraries I can find will compile with your sketch. :-/