[osg-users] how to convert float to osgText::String

Robert Osfield robert.osfield at gmail.com
Thu Apr 28 11:31:30 PDT 2011


Hi Nan,

The easiest way for converting a float to a string with Standard C++
is to use a stringstream and just direct the output you want to a
stream, then get the std::string from this using stream.str(). Once
you have a std::string you can pass this to osgText::Text.

Robert.

On Thu, Apr 28, 2011 at 6:27 PM, Nan WANG <nan.ccie at gmail.com> wrote:
> Hi,
>
> I have a simple question
> How to convert a float number to osgText::String in order to display with  osgText::Text::setText function?
>
>
>
> ...
>
> Thank you!
>
> Cheers,
> Nan
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=38855#38855
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



More information about the osg-users mailing list