Currency Formatting In Visualforce Page

Well few days ago while working with a Visualforce page I came across a requirement of showing currency field using proper currency formatting.


For Example

  • 6000 should appear as $6,000.00 in the vf page

After checking the standard Salesforce tags I was unable to find a solution. but somehow figured out that <apex:param> tag can be exploited here.

So do the currency formatting in a vf page you can use the below markup.

<apex:outputText value="${0, number, ###,###,###,##0.00}">  
      <apex:param value="{!Account.Amount__c}"/>  
 </apex:outputText>  

Hoping this helps for your currency formatting need!

12 comments:

  1. Thank you so much. Finally worked!

    ReplyDelete
  2. I used this in an inputText but not working , any workaround?
    Thanks

    ReplyDelete
  3. Hi,
    I need same while input values, I am using apex: inputfield component. Help me out.

    ReplyDelete
  4. Hi,
    I need same while input values, I am using apex: inputfield component. Help me out.

    ReplyDelete
  5. Hi,
    I need same while input values, I am using apex: inputfield component. Help me out.

    ReplyDelete
  6. Hi ,
    How to display it in french format something like this $6 000,00 where the separator is space and comma

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
  9. Hi Everyone,

    To get currency, you can also

    Hope this help

    ReplyDelete