I want to verify that an input parameter is an ordinal number, i.e, it only contains the values [0-9]. In perl, the solution would be a regular expression, but the Witango <@REGEX> is a little cumbersome for something this simple task.

<@ISNUM> will do this if I set @@request$currencychar, @@request$decimalchar, and @@request$thouasandschar to "".

But, the manual states:

"Tip There is a significant performance benefit to a setting of true for this configuration variable. Use a setting of false only if you must support different numeric formats over the course of a single application file execution. "

It sure would be nice to avoid a performance hit just to validate input.

It looks like the answer is an object in custom scope, so that I instead set @@custom$currencychar, @@custom$decimalchar, and @@custom$thouasandschar to "", and then pass my parameter to a method in the custom scope.

 Anyone have any other thoughts?

BTW, how does Witango handle the sign of a number? -$1,234.567 should be a valid number(with default numeric characters), but it doesn't look like it would pass the test of <@ISNUM> because of the minus sign.

Bill

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to