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=lists&body=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=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to