Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determine number type

Status
Not open for further replies.

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
 
Try the MOD operator.


<cfset YourNum=12>

<cfif YourNum MOD 2 EQ 0>
This is Even
<cfelse>
This is Odd
</cfif>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top