I didn't use dividing methods because Arduino haven't much precision least 8 digits. So I added long values as char array and getting it as float using atof() function. When I calling this function using 8012345678 it giving me as following result.
12345678
Float 8.12345695
It should be Float 8.12345678. but atof() is giving me wrong value. How can I fix this problem. I need least 8 digits accurate value for my calculation.
Thank You.
Please note that value is NOT a valid long value, which should not exceed 2,147,483,647. You mean 812345678 I suppose.
Anyway, first of all you don't need all that crap code to convert the long into a float, you just need one single line:
float f = longitude/100000000.0;
But you'll get the same result.
As said, you can't have float values with 8 digits precision on Uno, but if we're talking about GPS positioning I don't know what the rest of the code does, but are you sure you need such a single float value, instead of converting it into a dd°mm'ss"string, for example?
Cross-posting is against the Arduino forum rules. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend a lot of time investigating and writing a detailed answer on one topic, without knowing that someone else already did the same in the other topic.
Repeated cross-posting can result in a suspension from the forum.
In the future, please only create one topic for each distinct subject matter. This is basic forum etiquette, as explained in the "How to get the best out of this forum" guide. It contains a lot of other useful information. Please read it.