Gossamer Forum
Quote Reply
IF statement logic
Hi.. im wondering if my logic make sense

<%if Premium > 301%>
Action here
<%elseif Premium > 201 and Premium < 300%>
Another action here
<%elseif Premium > 0 and Premium < 200%>
Or another action here
<%endif%>

Am I doing the if correctly?

Premium its a field on my db and I'll try to use it to display links with different colors defined on my css

Thanks in advance for your help

Jesus
Quote Reply
Re: [Jesus] IF statement logic In reply to
1st of all, sorry I think i used the wrong forum to post my message :p

but anyway... my logic was correct :)

Jesus
Quote Reply
Re: [Jesus] IF statement logic In reply to
Hi,

Do you want to include 200 and 300?
Quote Reply
Re: [Payooo] IF statement logic In reply to
Hi Payooo

Thanks for your answer, you're right, i forgot to include those values. It should be:

<%if Premium >= 301%>
Action here
<%elseif Premium >= 201 and Premium <= 300%>
Another action here
<%elseif Premium > 0 and Premium <= 200%>
Or another action here
<%endif%>

That way it will include 200 and 300

Jesus