I often use compare()
to avoid undesired implicit conversion problems:
<cfif compare("010", testVal) EQ 0>
matches 010
</cfif>
But if you are just returning a single value, have you considered using a structure to do a simple look-up instead?
<cfset lookup = { "010"="matches 010", ...} >
<cfif structKeyExists(lookup, testVal)>
do something with #lookup[ testVal ]# ...
</cfif>
So as far as cfswitch is concerned; 010 is equal to 10
Edit: That sounds a little buggy IMO. The documentation mentions a similar issue with 0
versus 00
and states that it was fixed. But the error still occurs in CF 9. So you may want to submit a bug report.
The value "00" was also evaluated to the value 0. This caused the exception “Context validation error for tag CFCASE. The CFSWITCH has a duplicate CFCASE for value "0.0".” The tag now returns the expected result.