So I’m having issues with trailing zeros from number values. Like so I’m trying to set the text of a TextLabel to the number value but it has just a bunch of zero like; ex. 0.700000001. So for more clarification, I guess, is I’m getting a number value from a folder in the player and the value is fine so like; ex. 0.7. And I’m getting that value and setting it to a different number value that’s in a TextButton. The problem is when I’m setting a TextLabel’s text to the new number value (TextButton’s number value’s value) it has a bunch of trailing zeros and I have no idea why. So if anybody knows why, please inform me.
You can use string formatting to limit the number of decimal points:
local twoDecimals = string.format("%.2f", 1.000007)
1 Like
Actually thank you so much for this, this is so insanely easy compared to other sources claiming to be able to truncate trailing zeros and also this actually works.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.