I am trying to display the price of the item if the price is not equal to 0. Whats would be wrong with the usage below? The '0' here is a currency data type in the custom object. Please advise!

 <li><strong>{! ch.Name}</strong><span>
    <aura:if isTrue="{!equals(ch.sumchans__StandalonePrice__c, 0)}">
       (${! ch.sumchans__StandalonePrice__c})

Thanks All!


The {! pair starts the expression (and } terminates the expression) rather than the ! character negating the expression.

So use e.g.:

<aura:if isTrue="{! notequals(ch.sumchans__StandalonePrice__c, 0) }">


<aura:if isTrue="{! !equals(ch.sumchans__StandalonePrice__c, 0) }">
| improve this answer | |
  • 2
    +1 but I'm not sure I'd use the term "deliminter", since that might lead to some confusion (a delimiter can appear "between" values, but this only appears at the beginning). It's more fair to say that "{! starts an expression and is not part of the expression that is evaluated." or something like that. – sfdcfox Dec 10 '18 at 0:10
  • @sfdcfox Goog point, I've changed it. – Keith C Dec 10 '18 at 8:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.