
On Thu, 29 Jun 2006 18:58:26 +0200, "Boris" <boriss@web.de> wrote:
Yes, I use now "something like this". :) However I wonder if there is something more comfortable.
Yes, writing a small percentage class ;) boost::lexical_cast is about textual conversions, as performed by a standard stream with no special formatting (with a special treatment, explained in the docs, for string targets). "60%" is not a textual representation of a double in the standard lib view of things, thus you have no luck with that; but you can decide how *your classes* are streamed. Requirements indicated here <http://www.boost.org/libs/conversion/lexical_cast.htm#lexical_cast> are to be fulfilled for the class to work with lexical_cast<>. -- [ Gennaro Prota, C++ developer for hire ] [ resume: available on request ]