so...is customerSession.receiptOrder.discount a boolean? My guess is that it's not, but I can't tell from this code snippet.
The two things you might return should be the same...and int and an int, or a string and a string. 'null' (I think) can be anything, so it probably works in place of a float, which is what you get with your 0.0.
In short, I don't think this is right. I thing you want something like
customerSession.receiptOrder.discount is null ? 0.0 : customerSession.receiptOrder.discount
Never ascribe to malice that which can be adequately explained by stupidity.
Dan Acuff
Ranch Hand
Joined: Jul 13, 2009
Posts: 60
posted
0
Ahh a ternary operator is what it is called huh... nice.
Thanks for getting me straightened out, I came up with this working expression.
Thanks for your help!
This message was edited 1 time. Last update was at by Campbell Ritchie
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12612
posted
0
I'm confused. Is this Java? It doesn't look like Java. It looks more like some sort of EL. In any case, which forum should it be in?
EL is JSP, isn't it? But I can't remember seeing "var" in EL (but then again, it's been a while). I first thought it was JavaScript but the # and eq aren't part of that.