Suppose the number is 18.9999, how would I make that number into an 18 in a script/how would I remove all decimals?
This can easily be done by using math.floor()
local Number = 18.78679456656854765 local b = math.floor(Number) print(b)
math.floor returns the lowest Value,
math.ceil returns the Highest
local Number = 18.9999 local RoundLow = math.floor(Number) -- 18 local RoundHigh = math.ceil(Number) -- 19 print(RoundLow, RoundHigh) -- "18 19"
A more useless Example:
local Round = -math.round(Number)+ math.floor(Number * 2)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.