....and about whether Cost is truly a Boolean...

-----Original Message-----
From: Rob Wilkerson [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 22, 2007 3:15 PM
To: CF-Talk
Subject: Re: Just a tidbit for those who might not have use iif before


Uh oh.  You're probably about to get hammered with responses related to the
performance cost...

On 3/22/07, Peterson, Chris <[EMAIL PROTECTED]> wrote:
>
> I have never really used iif before, I was aware it existed but didn't 
> really see a good place for it.  Until today. =)
>
> Check this out:
>
> dollarformat(iif(Cost, cost, 0))
>
> That says, evaluate cost as a Boolean, if its true (anything but 0 or
> null) then return cost, otherwise return 0 (so the dollarFormat does 
> not
> break)  This is great instead of a <cfif> around the whole thing.
>
> Kinda cool =)
>
> Chris
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion?sdid=RVJW

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:273438
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to