There certainly should be an App Inventor function for this, I will add it to our (very long) Wish List.
Meanwhile: Check if number is an integer - #16 by TIMAI2