It's really not that hard, just use the MOD 2 function on your numeric field...
<CFFUNCTION name="headsortails" access="public" returntype="boolean" output="false">
<cfargument name="theVar" displayname="theVar" required="yes" type="numeric">
<CFSET var result = false>
<CFIF theVar MOD 2 EQ 0>
<CFSET result = true>
</CFIF>
<CFRETURN result>
</CFFUNCTION>
<CFOUTPUT>#headsortails(9)#</CFOUTPUT>
HTH,
Jeff Garza
----- Original Message -----
From: cfhelp
To: CF-Talk
Sent: Tuesday, November 25, 2003 3:17 PM
Subject: Even Odd?
Is there a CF Function that returns a True if a number is even?
Rick
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
- Even Odd? cfhelp
- RE: Even Odd? Raymond Camden
- RE: Even Odd? Jeff Garza
- RE: Even Odd? cfhelp