It will not work for decimals.EDIT: And no, the code I posted will. Yours has errors in it.
function isInt(%n){ return %n $= %n * 1;}