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.

<cfif int(variable) EQ (variable)>

the variable is an integer

<cfelse>

it's not an integer

</cfit>



(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]

Reply via email to