I am looking for a function similar to atol
(char * to long int) but atofl
(char to long double), does anyone know of a library that does this, or a simple way to do this, since using
atof
on "0.00000005" casts off the 5?
Thanks.
Asked
Active
Viewed 1,591 times
2 Answers
2
I think you have use the wrong argument of printf, so you only saw the console giving you "0.000000", you can try
printf("%0.10f", atof(str_num));
to show the your number, and you will find what you want.

MYMNeo
- 818
- 5
- 9
1
There is a function called strtod
that does what you want.

Some programmer dude
- 400,186
- 35
- 402
- 621
-
4char to long double is `strtold`... though the OP has already selected your answer! – salva Jun 12 '12 at 07:38