You would assume that the isNumeric fucntion would return a false value if you passed it an alphanumeric string. However, after checking through some things; it appears that it considers 6,6 as an numeric value.
In this instance, the value is coming from a query string so you would assume that the variable sub-type would be a string. If you test that using the VarType function, it does indeed return a value of 8 (indicating VBString as the sub-type), yet some how it is also numeric.
The only way I can see that this is logical, is that it might be allowing the comma through based on the premise that it is a valid currency formatting character, such as $123,456.78. The Microsoft documentation for isNumeric indicates that it will allow a period (.) through, however mentions nothing about a comma at all.
A simple code example:
Dim sValuesValue = 6Response.Write isNumeric(sValue) ' prints TruesValue = 6.0Response.Write isNumeric(sValue) ' prints TruesValue = "6,6"Response.Write isNumeric(sValue) ' prints TruesValue = "6, 6"Response.Write isNumeric(sValue) ' prints False
If it is allowing the comma through for currency reasons then I would consider the function to be flawed. A comma isn’t part of a number system, it is part of a currency system which changes from country to country. Further to that point, if isNumeric considers “6,6” to be a number, then you should also be allowed to cast it into a numeric type (from the variable sub-type VBString) into an integer for instance.