3 Replies Latest reply on Dec 30, 2010 2:30 PM by miguel8312

    String to number fails when letter after number?

    miguel8312 Level 3

      kind of confused hopefully someone can answer this question. i have a function to verify that a string is a number as such.

      
      
      
      isNaN(parseInt(num));
      
      
      
      return !isNaN(parseInt(num));}
      
      
      Public function isNumeric(num:String):Boolean             { 
      


      so if a send in the value of "aa" it returns false. Great!! however if i send "1a" it returns true? however that is not a number? can anyone offer any suggestions. I ti have farther test this by looking at what value the function think it is after i send  value "1a" and it thinks that the value is "1" so i guess my only other option to stop this would be to move the string into and array and loop through the entire string looking for non numeric values? is that what i need to do?

      Miguel