I'm trying to do some conditional formatting for the Opportunity Amount field on a VisualForce page that just displays the currently set amount. There is a chance that the amount can be negative (due to carry over credits) and I want to be able to display the Amount in parentheses if it's negative.
I think I'm missing something basic about how to reference an object's fields, but I haven't been able to Google-up an example that could help me with this.
Here's my VF code:
<apex:outputText value="Opportunity Amount"></apex:outputText>
<apex:outputText value="{!IF(opportunity.Amount < 0, '$(' + opportunity.Amount + ')', '$' + opportunity.Amount)}"></apex:outputText>
I know I'm probably missing something very basic here, but would really appreciate some help.
Thank you!