util.is_int
This commit is contained in:
@@ -79,6 +79,13 @@ end
|
||||
|
||||
-- MATH --
|
||||
|
||||
-- is a value an integer
|
||||
---@param x any value
|
||||
---@return boolean if the number is an integer
|
||||
function util.is_int(x)
|
||||
return type(x) == "number" and x == math.floor(x)
|
||||
end
|
||||
|
||||
-- round a number to an integer
|
||||
---@return integer rounded
|
||||
function util.round(x)
|
||||
|
||||
Reference in New Issue
Block a user