Re: convert char * to double



On 2/24/06, Mickael Drean <mickael drean gmail com> wrote:
> Hello,
>
>   I'm not sure but maybe  " istringstream " method can help you.
>
> Bye

Yeah, you could try something like this:
   std::istringstream istrm(number_string);
   double number;
   istrm >> number;

I believe istringstream should honor your locale and parse the comma
as a decimal separator (though I haven't tested it).  But if not, you
may need to mess around with istringstream::imbue() or something
similar.

Jonner



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]