It's a bug. There's no reason "1,000.00" should validate as a numeric value
of any kind; and "float" is a subset of numeric.

Railo returns false for both. As does OpenBD.

-- 
Adam




On 3 December 2013 22:05, Scott Brady <[email protected]> wrote:

>
> The docs for isValid() imply that the type "numeric" and "float" are
> equivalent, in that they're listed together.  However, they can yield
> different results:
> isValid("numeric","1,000.00") returns false
> isValid("float","1,000.00") returns true
>
> This came up as we're dealing with an issue of users entering "1,000.00"
> [or something similar] into a field, which can cause problems in one area
> of code where we need that value to be a valid number (i.e., we want to use
> it in a calculation, which results in an error).  We can use
> lsParseNumber(0 around the value, but first we need to make sure it's a
> valid number anyway. So, we're somewhat forced into using
> isValid("float",....) which is fine.
>
> But, is this a bug with the actual isValid() function or is it more of a
> documentation error (i.e., behind the scenes, "float" and "numeric" are
> different and "1,000.00" is not a valid numeric but is a valid float)?
>
> Scott
>
> --
> -----------------------------------------
> Scott Brady
> http://www.scottbrady.net/
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357257
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to