Don't know what to tell ya... This is from the CF 5.0 docs (probably the
same in CF 4.5.2)regarding numeric values.
=========================================================Integer
Numbers with no decimal point. The lower limit for a signed integer is
-2,147,483,648, and the upper limit for a signed integer is 2,147,483,647.
If you specify an integer outside the limits, ColdFusion converts it to a
floating point value to avoid overflow. In doing so, ColdFusion preserves
the number's magnitude. However, the conversion to floating point comes at
the expense of precision, since ColdFusion has only a fixed number of bits
to work with.
Real number
Numbers with a decimal part. Also known as floating point numbers.
The range of ColdFusion numbers is approximately �10300. Most operations are
accurate to 12 digits after the decimal point.
ColdFusion supports scientific notation; this means that you can enter
numbers in the form 3 E 16 and perform calculations on them.
=========================================================
It's evaluating it as a real number in scientific notation. I can't think
of a workaround except to try running a number format first and then
evaluating.
Jeff Garza
Lead Developer/Webmaster
Spectrum Astro, Inc.
480.892.8200
[EMAIL PROTECTED]
http://www.spectrumastro.com
-----Original Message-----
From: Evan Lavidor [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 06, 2001 7:53 AM
To: CF-Talk
Subject: IsNumeric Weirdness
I asked this on CFDJList a couple of weeks ago when this list was down, and
though many tried to help out, I still just don't get it, so I wanted to see
if someone here could shed some light on the subject...
Here's the test code:
---------------------------------------------
<cfset myvariable = "3D1">
<cfoutput>
<p>#IsNumeric('3D1')#</p>
<p>#myvariable#</p>
<p>#IsNumeric(myvariable)#</p>
</cfoutput>
This returns:
Yes
3D1
Yes
---------------------------------------------
WTF?!? Shouldn't I be seeing No, 3D1, No? Is it evaluating "3D1" as a
binary or octal value of some kind? Why is it passing an IsNumeric test?
I'm running 4.5.1SP2.
Interestingly, 3A1, 3B1, 3C1, and 3F1 all fail, but 3E1 produces the same
result.
I understand in theory why 3E1 works, that's a form of scientific notation
(3x10^1 = 30), but 3D1?????
Thanks,
Evan
--
-=-=-=-=-=-=-=-=-=-
Evan Lavidor
Circle.com Boston
Tel: 617-585-3107
Fax: 617-585-3091
-=-=-=-=-=-=-=-=-=-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists