playMaker

Author Topic: Why is Set Property > text > To String showing up with decimals?  (Read 687 times)

christerf

  • Playmaker Newbie
  • *
  • Posts: 6
When I drag UI text into my FSM and Set Property > text > To String and run my game it get a decimal place (ie: Health = 10.0 instead of 10). Why is that and how do you fix it? Every video I've watched doesn't show any decimal by default.
Thanks!
« Last Edit: March 17, 2021, 12:41:55 PM by christerf »

Gustav

  • Junior Playmaker
  • **
  • Posts: 53
Re: Why is Set Property > text > To String showing up with decimals?
« Reply #1 on: March 17, 2021, 01:32:22 PM »
The Variable Player_Health is of type Float. If you don't want it to be decimal, change the type to Int. Or use the action Convert Float To Int before using it in the UI.


Regards
Gustav

christerf

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Why is Set Property > text > To String showing up with decimals?
« Reply #2 on: March 17, 2021, 02:36:13 PM »
Thanks Gustav - that worked! You saved me a lot of time here.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Why is Set Property > text > To String showing up with decimals?
« Reply #3 on: March 17, 2021, 03:18:36 PM »
Hi.
Convert to float to string works as well and you can set a format.

Gor example you want it to be 001 instead of 1 then set format 000
If you want it to be 1 then set format 0
If you want it to be 1.0 set format to 0.0