Re: convert char * to double
- From: "Jonathon Jongsma" <jonathon jongsma gmail com>
- To: "Mickael Drean" <mickael drean gmail com>
- Cc: gtkmm-list gnome org
- Subject: Re: convert char * to double
- Date: Fri, 24 Feb 2006 10:56:15 -0600
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]