in reply to Better way to write these checks?

See also the 2007 thread Equality checking for strings AND numbers, which may give you some useful ideas.

And note the point raised there by BrowserUk:

If your data can contain reals, you might want to think about whether 10.0 == 10.000000000000001, or not.

and the replies by lin0 and halley on how to handle this issue.

HTH,

Athanasius <°(((><contra mundum