Thread: isnumeric

  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    128

    isnumeric

    I'm looking for an isnumeric function. I saw a few diference google references but the best I can make is:
    Code:
    			if (!isnumeric(strSSN))
    			{
    				strSSN = "000000000";
    			}
    This gives me "'isnumeric' : undeclared identifier"

    What header shoudl I user? I'm guessing that's the problem.

  2. #2
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    isdigit() will test one character to see if it is a valid digit. You could easily write your own isnumeric() function to test the entire string. Don't forget to allow for '-' and '.' characters in the string.

Popular pages Recent additions subscribe to a feed