Set the value to not be decimal and how to stop a text label from moving when the text has changed

  1. I have a current speed value which I set to the text on the text label, now its a big value that I got from the part.velocity.magnitude(example 12.345654354),how can I set that value so it’s not decimal when it gets put on a text label? So it doesn’t say 12.3456 but just 12.
    2)I have this altitude text label too,this is how it looks.

now my problem is when I set the value to lets say 10 it shows like this:


and not like I want it to look:

How can I make it work like I want? Thanks!

To solve your second problem, I believe that there’s a property of TextLabel that aligns the text to the right side. I think it’s called TextXAlignment

So you can use math.floor. It returns the largest integer which is smaller than the number passed.

math.floor(12.2134)

And you can set the TextXAlignment property of the label to right.

If you get an IntValue, and set the value of that IntValue to the number, then use that for the text label, IntValues don’t support decimal so it’ll round the number.

Thank you all for your help, all your replies were helpful I wish I could’ve given you all the solution checkmark!

1 Like