hi when i try to get a position of something it just has a bunch of decimals behind it is there a way to round this so it doesnt have these decimals?
you can use math.floor
or math.ceil
math.floor
will round a number down
math.ceil
will round a number up
Examples:
print(math.floor(8.793186816)) --> 8 print(math.ceil(8.4391595)) --> 9
So what we do to round it up to the nearest whole number is we add 0.5 to it(if your'e using math.floor
) but if you're using math.ceil
then subtract 0.5
print(math.floor(8.793186816 + 0.5)) --> 9 print(math.ceil(8.4391595 - 0.5)) --> 8