Sorry for the bad question, but really simply how do this..:
number = 1.9999
--change
print(number)
Will print 2 rather than 1.9999.. etc
So how do I get a singular number without its decimals.
Sorry for the bad question, but really simply how do this..:
number = 1.9999
--change
print(number)
Will print 2 rather than 1.9999.. etc
So how do I get a singular number without its decimals.
Wouldn't a simple math.floor() do the job?
You need to define the type to use.
Here is the script I used:-
local a = 4.0342
print(tonumber(string.format("%d",a))) -- %d defines the type
this uses string formatting to only take the number and not the decimals, then converts back to a number.
Hope this helps
Sorry I don't have time to find a list of data types.
This discussion is preserved as it was. New answers, comments, and votes are closed.
4 comments
I like this answer the most.
http://prntscr.com/av2apv - Help?
Haven't been on a while, sorry.
When a number ends in e-007, it means that the number is 7 decimal places smaller than it really is. For example, your first number 4.768371e-007 means that the number's true value is 0.0000004768371. It is a common bug found in roblox.