Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I check if something is a decimal or not?

Title says it all, so is there a way to do something like return false if a value is for example, 3 then return true if it's something like 2.37777777777?

1 answer

✓ Accepted answer

Yes. Something like this function should work:

function isInteger(n)
	return math.floor(n) == n
end

This discussion is preserved as it was. New answers, comments, and votes are closed.