so ive been reading up about strings but im not sure what “%.1f” means. i appreciate any help!
here is the line i was reading:
print(string.format("%s is close (%.1f studs away)", otherPlr.Name, dist))
original post:
so ive been reading up about strings but im not sure what “%.1f” means. i appreciate any help!
here is the line i was reading:
print(string.format("%s is close (%.1f studs away)", otherPlr.Name, dist))
original post:
It just means to format the number as a floating number with 1 decimal place value. You can change that number to whatever will work for you as well:
print(string.format("The number: %.3f", 1.5352362631666))
-- > 1.535
Keep in mind that the result will be a string!
wow that makes a lot more sense now, thanks a million locard
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.