RE: Integer?

2000-04-12 Thread jstiefel

You missed a previous message where I stated that isNumeric() will return
true with any string that contains (0-9) i.e. ReFind("(0-9)","012345678") is
identical to isNumeric("012345678"). However, try using "012345678" with the
Mod operator, and it will tell you that it can't be converted to an integer.
Go figure.

-Original Message-
From: Reuben King [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 11, 2000 4:36 PM
To: [EMAIL PROTECTED]
Subject: RE: Integer?


I have CF 4.5.1 and this statement simply isn't true.  IsNumeric() 
returns a true no matter how many 0's prepend a number, as long as the 
number is a number.  Maybe in earlier versions of CF it returned a 
false, but if it did I am not aware of it.


In D09A1A0FB7FDD211A92D00805FBBD8A1A578A3@CLTNTSXCHANGE, 
[EMAIL PROTECTED] ([EMAIL PROTECTED]) in a fit of unbridled passion, 
wrote:
 An integer is a range of "real numbers", usually with a limit around 999
 million or so (depends on the language, C defines a smallint as 1-37,000
for
 example.) I can't find any documentation stating ColdFusion's limits with
 integers. ColdFusion doesn't see a number with a leading 0 as a number,
thus
 it can't be an integer...
 
 Anyone know what the maximum size for an integer in CF is?
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 11, 2000 12:15 PM
 To: [EMAIL PROTECTED]
 Subject: RE: Integer?
 
 
 Huh?  Do you mean because of the leading zero?  Most of the time computers
 can ignore that.  What else makes it not an integer?  If I write it as
 1,234,567,890 is it an integer?
 
 Not wanting to fight, but curious..
 
 
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 11, 2000 11:21 AM
 To: [EMAIL PROTECTED]
 Subject: RE: Integer?
 
 
 How could a number "01234567890" be an integer? It's not even a real
number!
 
 


 --
 Archives: http://www.eGroups.com/list/cf-talk
 To Unsubscribe visit
 http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
 send a message to [EMAIL PROTECTED] with 'unsubscribe' in
 the body.


--
 Archives: http://www.eGroups.com/list/cf-talk
 To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
 

-- 

Reuben King mailto:[EMAIL PROTECTED]
Senior Web Consultant
Stonebridge Technologies http://www.sbti.com/
Phone: (512) 502-3332

--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Integer?

2000-04-11 Thread mherbene

Well, "01234567890" _is_ an integer, unless the rules have changed.  Maybe
it's  too big for the mod function, though; CF can't handle large numbers (I
don't remember exactly what "large" is).  How about either

val(form.myField) MOD 100

or 

cfif len(form.myfield) LT 6  !---maybe not six, try yourself ---
  cfif form.myfield MOD 100 
...
/cfif

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 11, 2000 9:56 AM
To: [EMAIL PROTECTED]
Subject: Integer?


Hopefully someone can shed some light on this. I've got a field where I'm
looking for an integer. I then need to verify that this field is in an
increment of 100:

cfif form.myField Mod 100
It's not an increment of 100!
/cfif

Alrighty, that works fine, unless I enter a non-integer in the field (i.e.
"01234567890", even though CFFORM validates this as an integer!) 
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: Integer?

2000-04-11 Thread Alexander Lamon

Use the IsNumeric function to test for a number value, then perform your 
MOD stuff


Hopefully someone can shed some light on this. I've got a field where I'm
looking for an integer. I then need to verify that this field is in an
increment of 100:

cfif form.myField Mod 100
   It's not an increment of 100!
/cfif

Alrighty, that works fine, unless I enter a non-integer in the field (i.e.
"01234567890", even though CFFORM validates this as an integer!) 

My first thought here is to use the Int() function to round this to the
nearest integer:

cfif Int(form.myField) Mod 100
   It's not an increment of 100!
/cfif

BUT NO! This does not work as advertised. I'm still getting a "Cannot
convert to integer" from the Mod operator. Is anyone out there dealing with
validating a user's input as an integer? Suggestions?


Jason Stiefel
Applications Developer
iXL, Inc.
1930 Camden Road, Suite 2070
Charlotte, NC 28203
tel. 704.943.7000
fax. 704.943.7001
[EMAIL PROTECTED]
 
--

Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or 
send a message to [EMAIL PROTECTED] with 'unsubscribe' in 
the body.
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: Integer?

2000-04-11 Thread Chris Tazewell

Try this:

CFIF IsNumeric(myformfield)
 CFSET newint = Int(myformfield)

 CFIF newint MOD 100
  not an integer
 /CFIF
/CFIF

Taz

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, April 11, 2000 2:55 PM
Subject: Integer?


 Hopefully someone can shed some light on this. I've got a field where I'm
 looking for an integer. I then need to verify that this field is in an
 increment of 100:

 cfif form.myField Mod 100
 It's not an increment of 100!
 /cfif

 Alrighty, that works fine, unless I enter a non-integer in the field (i.e.
 "01234567890", even though CFFORM validates this as an integer!)

 My first thought here is to use the Int() function to round this to the
 nearest integer:

 cfif Int(form.myField) Mod 100
 It's not an increment of 100!
 /cfif

 BUT NO! This does not work as advertised. I'm still getting a "Cannot
 convert to integer" from the Mod operator. Is anyone out there dealing
with
 validating a user's input as an integer? Suggestions?


 Jason Stiefel
 Applications Developer
 iXL, Inc.
 1930 Camden Road, Suite 2070
 Charlotte, NC 28203
 tel. 704.943.7000
 fax. 704.943.7001
 [EMAIL PROTECTED]

 --

 Archives: http://www.eGroups.com/list/cf-talk
 To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.


--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Integer?

2000-04-11 Thread jstiefel

How could a number "01234567890" be an integer? It's not even a real number!


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 11, 2000 10:28 AM
To: [EMAIL PROTECTED]
Subject: RE: Integer?


Well, "01234567890" _is_ an integer, unless the rules have changed.  Maybe
it's  too big for the mod function, though; CF can't handle large numbers (I
don't remember exactly what "large" is).  How about either

val(form.myField) MOD 100

or 

cfif len(form.myfield) LT 6  !---maybe not six, try yourself ---
  cfif form.myfield MOD 100 
...
/cfif

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 11, 2000 9:56 AM
To: [EMAIL PROTECTED]
Subject: Integer?


Hopefully someone can shed some light on this. I've got a field where I'm
looking for an integer. I then need to verify that this field is in an
increment of 100:

cfif form.myField Mod 100
It's not an increment of 100!
/cfif

Alrighty, that works fine, unless I enter a non-integer in the field (i.e.
"01234567890", even though CFFORM validates this as an integer!) 

--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Integer?

2000-04-11 Thread mherbene

Huh?  Do you mean because of the leading zero?  Most of the time computers
can ignore that.  What else makes it not an integer?  If I write it as
1,234,567,890 is it an integer?

Not wanting to fight, but curious..



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 11, 2000 11:21 AM
To: [EMAIL PROTECTED]
Subject: RE: Integer?


How could a number "01234567890" be an integer? It's not even a real number!


--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Integer?

2000-04-11 Thread Jim Vu

it appears that coldFusion can't handle very large integer. one work around
solution is to check for the last two digits being "00". if they are, the
integer is divisible (or increment of) by 100. here's the fix:
cfif isNumeric(form.myField)
cfset rightTwoDigits = right(form.myField, 2)
cfif rightTwoDigits IS NOT "00"
It's not an increment of 100!
cfelse
yes, it is
/cfif
/cfif

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 11, 2000 6:56 AM
To: [EMAIL PROTECTED]
Subject: Integer?


Hopefully someone can shed some light on this. I've got a field where I'm
looking for an integer. I then need to verify that this field is in an
increment of 100:

cfif form.myField Mod 100
It's not an increment of 100!
/cfif

Alrighty, that works fine, unless I enter a non-integer in the field (i.e.
"01234567890", even though CFFORM validates this as an integer!) 

My first thought here is to use the Int() function to round this to the
nearest integer:

cfif Int(form.myField) Mod 100
It's not an increment of 100!
/cfif

BUT NO! This does not work as advertised. I'm still getting a "Cannot
convert to integer" from the Mod operator. Is anyone out there dealing with
validating a user's input as an integer? Suggestions?


Jason Stiefel
Applications Developer
iXL, Inc.
1930 Camden Road, Suite 2070
Charlotte, NC 28203
tel. 704.943.7000
fax. 704.943.7001
[EMAIL PROTECTED]
 

--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Integer?

2000-04-11 Thread Reuben King

In [EMAIL PROTECTED], 
[EMAIL PROTECTED] ([EMAIL PROTECTED]) in a fit of 
unbridled passion, wrote:
 Huh?  Do you mean because of the leading zero?  Most of the time computers
 can ignore that.  What else makes it not an integer?  If I write it as
 1,234,567,890 is it an integer?
 
 Not wanting to fight, but curious..

The previous poster is incorrect. "01234567890" is indeed an integer.  
The computer of course ignores the leading 0. CF's precision will only 
go up to  (12 digits) and then it starts using scientific 
notation.. (1.23456789012E+012).  So, if you want to handle numbers over 
a trillion precisely, you'll have to do some creative programming.

Also, beware the commas.  Strip them out before using val() or integer
().


 
 
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 11, 2000 11:21 AM
 To: [EMAIL PROTECTED]
 Subject: RE: Integer?
 
 
 How could a number "01234567890" be an integer? It's not even a real number!
 
 
 --
 Archives: http://www.eGroups.com/list/cf-talk
 To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
 

-- 

Reuben King mailto:[EMAIL PROTECTED]
Senior Web Consultant
Stonebridge Technologies http://www.sbti.com/
Phone: (512) 488-8885 x3332
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Integer?

2000-04-11 Thread Grainne E. O'Neill

I'm going to lay out what numbers are what.  For programming purposes these
definitions vary.




All Numbers
Imaginary: Numbers that do not exist for practical purposes.  They have real
value in some engineering fields, and in mathematics.  What number, when
multiplied with itself gives you a negative result.  That would be an
imaginary number.
Real: All numbers that are either negative or positive.  No imaginary
numbers are real numbers.
Rational: All numbers that can be put in fraction form.
Irrational All numbers that cannot be put in fraction form.
Integers: All numbers that do not contain a decimal point
Whole: All numbers that are integers and are not negative
Natural: All numbers that are integers and are not negative and are not
zero.



--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Integer?

2000-04-11 Thread Reuben King

I have CF 4.5.1 and this statement simply isn't true.  IsNumeric() 
returns a true no matter how many 0's prepend a number, as long as the 
number is a number.  Maybe in earlier versions of CF it returned a 
false, but if it did I am not aware of it.


In D09A1A0FB7FDD211A92D00805FBBD8A1A578A3@CLTNTSXCHANGE, 
[EMAIL PROTECTED] ([EMAIL PROTECTED]) in a fit of unbridled passion, 
wrote:
 An integer is a range of "real numbers", usually with a limit around 999
 million or so (depends on the language, C defines a smallint as 1-37,000 for
 example.) I can't find any documentation stating ColdFusion's limits with
 integers. ColdFusion doesn't see a number with a leading 0 as a number, thus
 it can't be an integer...
 
 Anyone know what the maximum size for an integer in CF is?
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 11, 2000 12:15 PM
 To: [EMAIL PROTECTED]
 Subject: RE: Integer?
 
 
 Huh?  Do you mean because of the leading zero?  Most of the time computers
 can ignore that.  What else makes it not an integer?  If I write it as
 1,234,567,890 is it an integer?
 
 Not wanting to fight, but curious..
 
 
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 11, 2000 11:21 AM
 To: [EMAIL PROTECTED]
 Subject: RE: Integer?
 
 
 How could a number "01234567890" be an integer? It's not even a real number!
 
 
 
 --
 Archives: http://www.eGroups.com/list/cf-talk
 To Unsubscribe visit
 http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
 send a message to [EMAIL PROTECTED] with 'unsubscribe' in
 the body.
 --
 Archives: http://www.eGroups.com/list/cf-talk
 To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
 

-- 

Reuben King mailto:[EMAIL PROTECTED]
Senior Web Consultant
Stonebridge Technologies http://www.sbti.com/
Phone: (512) 502-3332
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.