convert float to String

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
pabloa
Not too shy to talk
Not too shy to talk
Posts: 37
Joined: Mon Oct 03, 2005 09:52

convert float to String

Postby pabloa » Thu Nov 17, 2005 11:40

hi, I would like get into setText one float, scrollbar->getScrollerPosotion to chek one thing in my program. I tried casted

Code: Select all

CEGUI::String s;
s=(CEGUI::String)sb->getScrollPosition();
//and some lines after
scrollbar->setText(s);


the error was cant convert 'float' to 'CEGUI::String'

how can I do it and what conversion are allow?

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: convert float to String

Postby lindquist » Thu Nov 17, 2005 15:28

Code: Select all

#include "CEGUIPropertyHelper.h"

CEGUI::String s = CEGUI::PropertyHelper::floatToString(123.456f);

User avatar
pabloa
Not too shy to talk
Not too shy to talk
Posts: 37
Joined: Mon Oct 03, 2005 09:52

Re: convert float to String

Postby pabloa » Fri Nov 18, 2005 10:47

Thanks it run! but getscrollposition return the origin position and when you move it the float didnt chage.... I would like see news values...


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 2 guests