Checking Or Testing If a Value / Variable Is Integer (number) In Coldfusion
This is of course is important because we do not want a wrong data type to use in our where clause with our cfquery right?
This is actually very easy, just use:
With isnumeric function you can test if a value is an integer or not, here is a basic example.
cfif #isnumeric(myvariable)# eq true
cfset result="variable is numeric"
cfset result="variable is not numeric"
Of course we would put a greater than and less than sign at every start and end each line, but I know you can understand the purpose of this code.
Also, I tried doing
cfif #isnumeric(myvariable)# eq "true"
and the result is still the same.
Well, that's all for now, hope this helped you.
Happy programming and good luck to you project!