Apr 9, 2001 #1 bobbyr Programmer Nov 30, 2000 66 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 Apr 6, 2001 171 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>