
29 Jun
2006
29 Jun
'06
11:40 a.m.
I'm using boost::lexical_cast to convert strings to double. However I just run into a string with a percent sign where boost::lexical_cast throws boost::bad_lexical_cast. As far as I can see there is no way to configure boost::lexical_cast to convert eg. "60%" to 0.6. I also checked out boost::numeric_cast but from what I read I think it doesn't help either. Is there anything in Boost which I can use to convert a more descriptive string like "60%" to a double? Boris