Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: cleave on May 01, 2018, 12:26:45 PM
-
How could I convert a float to percentage format,then display in the text?
For example, I got math results for floats like 0.5 1.5
I would like to display like this, 0.5 = 50% 1.5 = 150%
is there any actions to realized this?
-
Hi,
1st thing that comes in my mind is to do something like this :
use a 'float operator' and multiply by 100 (and save in a different variable),
Then 'convert float to string' (and set format 0 so you won't display anything behind the .)
Then 'build string' with 2 parts.
in part 1 (Element 0) set the string variable from the converted float.
in part 2 (Element 1) set %
and store in a variable.
Then you can use that to display the value.
-
Thanks a lot
-
Hi.
Happy to help :)
-
Thanks this was exactly what I needed!
Hi,
1st thing that comes in my mind is to do something like this :
use a 'float operator' and multiply by 100 (and save in a different variable),
Then 'convert float to string' (and set format 0 so you won't display anything behind the .)
Then 'build string' with 2 parts.
in part 1 (Element 0) set the string variable from the converted float.
in part 2 (Element 1) set %
and store in a variable.
Then you can use that to display the value.