Formatting tinygps output

On my lcd display i have GPS output that looks like

LAT 58.227700
LON 6.8718
LAT 9.89

But what i want is that ik looks like:

LAT 58.227700
LON  6.8718
LAT  9.89

I am looking at sprintf to use but i cant find any reference on the Arduino site how to use this.
using :

char buffer[21];
sprintf(buffer, LAT %d", (gps.location.lat(), 6) );
lcd.print(buffer);

The output on the lcd looks like LAT -8545 and thats anywhere near it should be.

Anny suggestions?

You are printing a float as an integer.

sprintf() will not work with floats in the Arduino environment.

How about using a simple function to output the float sent to as it as an argument. In the function check the value of the float and if it is less than 10 then print a space before it or if the value may exceed 100 then check twice and print the appropriate number of spaces.

(gps.location.lat(), 6)

You are abusing the comma operator. This part of the function call is NOT doing what you seem to think it is doing.

Is lat() returning a float or a string?