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

2011-04-29 Thread Nan WANG
Hi, Tomlinson and robert thanks a lot for your ideas i usually use standard c method...sprintf should be another simple way I am thinking whether in OSG we have something more professional/directly... Thanks again. ... Thank you! Cheers, Nan -- Read this topic

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

2011-04-28 Thread Nan WANG
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

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

2011-04-28 Thread Jeremy Moles
On Thu, 2011-04-28 at 19:27 +0200, Nan WANG 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? Try ::createUTF8EncodedString(), or something like that. ... Thank you! Cheers, Nan

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

2011-04-28 Thread Robert Osfield
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,

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

2011-04-28 Thread Tomlinson, Gordon
penalties. From: osg-users-boun...@lists.openscenegraph.org on behalf of Nan WANG Sent: Thu 4/28/2011 1:27 PM To: osg-users@lists.openscenegraph.org Subject: [osg-users] how to convert float to osgText::String Hi, I have a simple question How to convert