Sunday 14 April 2013

Formatting in apex:outputText

Here are some example of how to format apex:outputText values using  apex:param :
  • Date formatting :
<apex:outputText value="{0,date,dd/MM/yyyy}">
        <apex:param value="{!E.Date_du_collecte__c}"/>
    </apex:outputText>

 
the 0, tell to take the first parameter, the date keyword specify the type of data, and the third parameter specify how to format the data.

  • Number formatting :
<apex:outputText value="{0,number,integer}">
        <apex:param value="{!opp.Amount}"/>
    </apex:outputText> 


the 0, tell to take the first parameter, the number keyword specify the type of data, and the third parameter specify how to format the data.

No comments:

Post a Comment