RE: Checking for a number

2004-04-02 Thread Tim Blair
If you're using isNumeric(), make sute that there isn't any whitespace
at the beginning/end of the "number":

http://tech.badpen.com/index.cfm?mode=entry&entry=16

Tim.

--
---

Maze Solver - http://tech.badpen.com/cfcontest/
---
RAWNET LTD - Internet, New Media and ebusiness Gurus.
WE'VE MOVED - for our new address, please visit our
website at http://www.rawnet.com/ or call us any time
on 0800 294 24 24.
---
This message may contain information which is legally
privileged and/or confidential.  If you are not the
intended recipient, you are hereby notified that any
unauthorised disclosure, copying, distribution or use
of this information is strictly prohibited. Such
notification notwithstanding, any comments, opinions,
information or conclusions expressed in this message
are those of the originator, not of rawnet limited,
unless otherwise explicitly and independently indicated
by an authorised representative of rawnet limited.
--- 

> -Original Message-
> From: Tony Weeg [mailto:[EMAIL PROTECTED] 
> Sent: 01 April 2004 20:35
> To: CF-Talk
> Subject: RE: Checking for a number
> 
> isNumeric() 
> 
> -Original Message-
> From: Tangorre, Michael [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 01, 2004 2:35 PM
> To: CF-Talk
> Subject: Checking for a number
> 
> What is the best way to check that a value is an integer?
>  
>  
> 
> 
> 
> 
>
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Checking for a number

2004-04-01 Thread Pascal Peters
This would work if you were looking for a natural number (is this the
term in English: positive integer).

Integer would be 

	integer

	not an integer


But of course there is a udf on cflib as usual (as Tony already pointed
out)

Pascal

> -Original Message-
> From: Charlie Griefer [mailto:[EMAIL PROTECTED] 
> Sent: donderdag 1 april 2004 21:44
> To: CF-Talk
> Subject: Re: Checking for a number
> 
> dunno if it's the -best- way...but would this work?
> 
> 
>  number is not an integer
> 
>  number is an integer
> 
>
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Checking for a number

2004-04-01 Thread Michael Kear
You can force it to be an integer, regardless of what it currently is by
#int(variable)# 

Therefore if this new integer, which you KNOW is an integer because you just
forced it to be one,  is equal to the variable you started with, then it
must have been an integer to start with. 

 

the variable is an integer



it's not an integer





(having said that, I'll probably find out there's a function that's existed
in CF since version 4 but I never knew it was there)

Cheers

Mike Kear

Windsor, NSW, Australia

AFP Webworks

http://afpwebworks.com

  _  

From: Tangorre, Michael [mailto:[EMAIL PROTECTED] 
Sent: Friday, 2 April 2004 5:35 AM
To: CF-Talk
Subject: Checking for a number

What is the best way to check that a value is an integer?

  _
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: Checking for a number

2004-04-01 Thread Charlie Griefer
dunno if it's the -best- way...but would this work?


 number is not an integer

 number is an integer


- Original Message - 
From: "Tangorre, Michael" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, April 01, 2004 12:35 PM
Subject: Checking for a number

> What is the best way to check that a value is an integer?
>
>
>
>
>
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Checking for a number

2004-04-01 Thread Barney Boisvert


 it's a number

 o, bad stuff


> -Original Message-
> From: Tangorre, Michael [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, April 01, 2004 11:35 AM
> To: CF-Talk
> Subject: Checking for a number
> 
> What is the best way to check that a value is an integer?
>  
>  
> 
> 
>
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Checking for a number

2004-04-01 Thread Tony Weeg
http://www.cflib.org/udf.cfm?ID=582 

-Original Message-
From: Tony Weeg [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 01, 2004 2:35 PM
To: CF-Talk
Subject: RE: Checking for a number

isNumeric() 

-Original Message-
From: Tangorre, Michael [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 01, 2004 2:35 PM
To: CF-Talk
Subject: Checking for a number

What is the best way to check that a value is an integer?
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Checking for a number

2004-04-01 Thread Tony Weeg
isNumeric() 

-Original Message-
From: Tangorre, Michael [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 01, 2004 2:35 PM
To: CF-Talk
Subject: Checking for a number

What is the best way to check that a value is an integer?
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]