Well if built-in libraries are not helping you then there is no other option - you should do it manually !

You could iterate over the string starting from (n-1)th position to 0th then if it is not 'decimal point' then typecast that character to int and store it to variable , say n by formuale "n+=10^(ith digit)" . If you encounter '.' then store its position (say in variable x) and after loop divide the number by "10^x" .

NOTE:(1)you should use "long long int" for n,x.
(2)if "10^x" or "10^i" maybe too large then calculate the numbers after '.' and before it in two separate long long int .
(3)You may first remove trailing zeroes from string if you want little more effeciency

Here's the formal Algorithm :-

123456789101112131415

/*Initializations -> 's' is string with number , 'n' is long long int in
which to store value , 'x' is position of '.' in string
from left to right , 'i' is counter var. *//*This is just algorithm , not code ,put little of your effort too ;)
and do tell me if any further problem */for (i=s.length()-1;i>=0;i--) {
if (s.at(i)=='.') x=i; else {
n+=10^((int)s.at(i))
}
n=n/(10^x)
}
//Now your number is in n !

Your ideal value of 148366.071110 is a little closer to the first one, so when you attempt to store it in a double, the code that is compiled is actually storing 148366.07110999998985789716243743896484375.

There is no way around this, unless you switch to arbitrary precision floating-point library such as GNU MP. In most applications, it's sufficient to choose the right rounding for output so that it *looks* like 148366.071110.