Apr 9, 2001 #1 bobbyr Programmer Joined Nov 30, 2000 Messages 66 Location US Anybody know the easiest way to determine if a number is odd or even in coldfusion? Thanks in advance! Bobby R
Anybody know the easiest way to determine if a number is odd or even in coldfusion? Thanks in advance! Bobby R
Apr 9, 2001 #2 CFHub Technical User Joined Apr 6, 2001 Messages 171 Location CA Try the MOD operator. <cfset YourNum=12> <cfif YourNum MOD 2 EQ 0> This is Even <cfelse> This is Odd </cfif> Upvote 0 Downvote
Try the MOD operator. <cfset YourNum=12> <cfif YourNum MOD 2 EQ 0> This is Even <cfelse> This is Odd </cfif>