basically this.
example:
local xAngle = 0.3280940912
i want it to only be 0.32 when i print it.
I dont know how to use string.format or that stuff
basically this.
example:
local xAngle = 0.3280940912
i want it to only be 0.32 when i print it.
I dont know how to use string.format or that stuff
Use string.sub
string.sub(xAngle,1,3)
In every programming language, these are referred to as “substrings,” which is why the function is called string.sub. A pretty common thing to search whenever you learn a new language is “python substrings” or “c# substrings” because it’s a really common function.
Just FYI. You’ll probably want to know that, it might be on a programming exam if you ever take one.
You’d want to do:
string.format("%.2f", xAngle)
This reduces the number to two decimal places
Or
tonumber(string.format("%.2f", xAngle))
-- if you want the number ^^