# check, if a value is integer - Macromedia ColdFusion

hello, how do i check, if a value is integer in cold fusion? <cfif myValue/4 isInteger> <!--- true if myValue is 4,8,12,16 and so on ---> make something <cfelse> <!--- if myValue is 1,2,3,5,6,7,9 and so on ---> make another thing </cfif> thanks for any help, Martin Nadoll...

1. ## check, if a value is integer

hello,

how do i check, if a value is integer in cold fusion?

<cfif myValue/4 isInteger> <!--- true if myValue is 4,8,12,16 and so on --->
make something
<cfelse> <!--- if myValue is 1,2,3,5,6,7,9 and so on --->
make another thing
</cfif>

thanks for any help,

2. ## Re: check, if a value is integer

You can determine if a number is an integer by performing:
<CFIF (foo \ 2) * 2 IS foo>

If the statement is true, you have an integer. However, you seem to be trying
to discriminate between multiples of 4.
You might want to do the following:
<CFIF foo mod 4 IS 0>

IF the statement is true, you have a multiple of 4.

jdeline Guest

3. ## Re: check, if a value is integer

<cfif Number EQ Round(Number)>
Number is integer
<cfelse>
Number is not integer
</cfif>

Mr Black Guest

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•