if ($string == "$string") { # It is a number }