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
AndyuxAndyux 

Number formating in VF

I am getting date from related object Opportunities - need to keep it in a table format (this is a large table), snipit
<td bgcolor="#BDD7E7"><strong>Close Date</strong></td>
<td bgcolor="#C9D2E2">{!CO__c.Opportunity__r.CloseDate}</td>
And it displays Tue Mar 02 00:00:00 GMT 2021
Can I make it display Mar 02 2021 ?

Similarly
<td bgcolor="#BDD7E7"><strong> Value</strong></td>
      <td colspan="3" bgcolor="#C9D2E2">${!(ROUND(CO__c.Opportunity__r.Amount,0))}</td>
displays $4502
Can I make it display $4,502 ?
(Add "," every 3 digits, no decimal)

Thanks!

 
Best Answer chosen by Andyux
Shashikant SharmaShashikant Sharma
Hi Yes,
You could acheive it by apex:outputText and providing formatting in there.
 
<apex:outputText value="{0, number,$###,###,##0}"><apex:param value="{!CO__c.Opportunity__r.Amount}" />
              </apex:outputText>

For more formatting options you could check: https://cloudjedi.wordpress.com/2011/08/17/formatting-numbers-or-dates-with-visualforce/

Thanks
Shashikant