Skip navigation
Currently Being Moderated

Infinity issue

Nov 26, 2012 6:32 AM

Hi All,

I have this issue:

StringIs NumberConverted Number
“123”true123
“123 Abc”falseNaN
“Infinity”trueInfinity
“Infinity Abc”trueInfinity

 

The next validation only works when the result is NaN, how can I validate the infinity?

if (isNaN(Number(tempString)))

     tempString = 0;

Thanks,

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points