function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
maddukurimaddukuri 

Currency symbol

In the VF page, I am trying to display $ and , symbols only if there is a value. If there is no value, I do not want the symbols to show. I have the line as

<td><apex:outputText value="{!ROUND((acc.Box_Charge__c*acc.X12_Mth_Containers__c)/12,2)}"></apex:outputText></td>

 

acc is the account. Only if the value is not null, I need to add the $ and comma symbols. Please help

Best Answer chosen by Admin (Salesforce Developers) 
SFDC_VikashSFDC_Vikash

Hi,

 

You can use this :

 

<apex:outputText value="{!IF(TEXT(ROUND(acc.Box_Charge__c*acc.X12_Mth_Containers__c)/12,2)) = '', '', '$' + TEXT(ROUND(acc.Box_Charge__c*acc.X12_Mth_Containers__c)/12,2)))}"/>

 

Please mark as solution if your problem is solved so that others can use this solution.

 

 

All Answers

SFDC_VikashSFDC_Vikash

Hi,

 

You can use this :

 

<apex:outputText value="{!IF(TEXT(ROUND(acc.Box_Charge__c*acc.X12_Mth_Containers__c)/12,2)) = '', '', '$' + TEXT(ROUND(acc.Box_Charge__c*acc.X12_Mth_Containers__c)/12,2)))}"/>

 

Please mark as solution if your problem is solved so that others can use this solution.

 

 

This was selected as the best answer
maddukurimaddukuri

Thank You Very Much! It worked!!!!!