Assigning float to 10 decimal place for longitude,latitude I'm quite a novice in arduino programming. I am doing a small home project and I am using sim808 to obtain GPS data.

My question is quite simple but i can't find any solution online.

Serial.print("latitude :");
Serial.println(sim808.GPSdata.lat, 10);
Serial.print("longitude :");
Serial.println(sim808.GPSdata.lon, 10;


This code display Longitude and Latitude data on serial monitor to 10 decimal place perfectly.

But when after setting the Longitude and Latitude to float.When I use this code, I don't get a valid gps data.

Longitude = (sim808.GPSdata.lon, 10 );
Latitude = (sim808.GPSdata.lat, 10 );


Please help, Thanks.

(edited)
I understand my error in coding for the above.

In fact, I am using a DF robot shield sim 808 for vehicle tracking. I am uploading my GPS data, longitude, latitude and speed to Ubidots. The only difficulty is in saving accurate data.

I am using this codes

Longitude = sim808.GPSdata.lon;
Latitude = sim808.GPSdata.lat;
Speedperkm = sim808.GPSdata.speed_kph;

client.add("Longitude", Longitude);
client.add("Latitude", Latitude);
client.add("Speed per Km", Speedperkm);


The code is working fine but only GPS data of 2 decimal place is being uploaded. If data of up to 6 decimal place is uploaded then the system will more accurate.

That my problem that I am trying to solve.
But when after setting the Longitude and Latitude to float.When I use
  this code, I don't get a valid gps data.


Some statements in C/C++ are not what they might seem. The value of the statements:

Longitude = (sim808.GPSdata.lon, 10 );
Latitude = (sim808.GPSdata.lat, 10 );


Are actually the same as:

sim808.GPSdata.lon; 
Longitude = 10; 
sim808.GPSdata.lat; 
Latitude = 10;


Which is then optimized to:

Longitude = 10.0; 
Latitude = 10.0;


That is, when using list notation, the value of the expression is the same as the value of last expression in the list.

The other answers have covered the fact that float and double on Arduino (AVR-GCC) are only 32-bit, and that gives 6 to 9 significant decimal digits precision.

Cheers!