Take the 2-minute tour ×  Why does atof round "14718.5084" to
14718.5? Is there a way to prevent that (i.e. get the whole
number 14718.5084)?   double latitude=atof("14718.5084");
std::cout <<"latitude test "<<latitude<< "\n";  and the output
is:  latitude test 14718.5   share|improve this question you
mean atof right? –  andrea.marangoni Apr 3 '12 at 11:26 i added
the code. –  user1106106 Apr 3 '12 at 11:33  5 Answers 5  Try
this code to see it does exactly what you want:  #include
<stdio.h> #include <stdlib.h>  int main ()   char input [256];
printf("Enter something: ");   printf("Result: %f\n",
atof(input));   return 0;  Maybe you lost the digits when
printing...  Try this:  double latitude=atof("14718.5084");
share|improve this answer +1 because of printing –  Tristram
Gräbener Apr 3 '12 at 11:31 i added my code now. thanks, but i
dont think printing is my problem –  user1106106 Apr 3 '12 at
11:34 Please see the additional code, printing it was ;) – 
HWende Apr 3 '12 at 11:40 I was going to answer 'prin