How would I determine if a variable (number) is an int or float?

How would I check if a number is an integer or a float (they’re not instances but in script)

local numA = 1
local numB = 1.3

print(typeof(numA).." "..typeof(numB)) -- : number number

Here it is:

local is_int = (num%1 == 0)

it will be true if it is int else it will be false.

Here you go:

function isInt(number)
  return (num%1 == 0)
end

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.