playMaker
Home
Store
Showcase
Tutorials
Forums
Manual
Wiki
About Us
Playmaker Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Join our
Discord Channel
Home
Help
Search
Login
Register
Playmaker Forum
»
PlayMaker Help & Tips
»
PlayMaker Help
»
Why is Set Property > text > To String showing up with decimals?
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: Why is Set Property > text > To String showing up with decimals? (Read 687 times)
christerf
Playmaker Newbie
Posts: 6
Why is Set Property > text > To String showing up with decimals?
«
on:
March 17, 2021, 11:52:24 AM »
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
»
Logged
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
Logged
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.
Logged
djaydino
Administrator
Hero Member
Posts: 7616
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
Logged
Join the PlayMaker Discord Channel!
Print
Pages: [
1
]
Go Up
« previous
next »
Playmaker Forum
»
PlayMaker Help & Tips
»
PlayMaker Help
»
Why is Set Property > text > To String showing up with decimals?