Andy Jarrett // Code. Develop. Create.

New UDF- isOddEven

This is just a small UDF that returns if a number is odd or even. Im usuing it in a <tr> tag to get a class from CSS.
<cfscript>
\n /**
\n+ Author : Andy Jarrett
\n+ Email : mail @ andyjarrett . co . uk
\n+ Created : 19/10/2004
\n**/
\n   function isOddEven(num){
\n      var outMsg = "";
\n      
\n      if(NOT isNumeric(num)){
\n         outMsg = "The passed variable was not numeric";
\n      }
\n      else{
\n         if(num MOD 2) outMsg = "odd";
\n         else outMsg = "even";
\n      }
\n      return outMsg;
\n   }
\n<cfscript>

I’m here, learning and working away. If you liked this content and want to keep me going, consider buying me a coffee. Your support keeps this site running and the coffee brewing! ☕️