I want to display the currency field with all the decimal places.Right now salesforce automatically rounds it to two decimal places. salesforce displays 123.45678 as 123.46 ,i want it to be 123.45678 on the detail page,it displays as 123.45678 on edit page.Is there any way to do it?!

enter image description here

4 Answers 4


Take a look at the docs on apex:outputText. You can use the Java MessageFormat format strings.

For example, the following will display US currency with six decimal places, formatted with comma separators, up to 999 trillion dollars and will always show six digits to the right of the decimal place due to the zeroes. This is Visualforce, though.

<apex:outputText value="{0, number, $###,###,###,###,##0.000000}">
    <apex:param value="{!myObject.My_Value__c}"/>

enter image description here

enter image description here

You can specify the decimal values for the field as shown in above screenshot

  • I had declared it with 6 decimal places,but on saving the record it rounds it to 2 decimal places.I dont see any image in your post Commented Oct 24, 2012 at 14:11
  • 1
    Is your page a visualforce page or a simple standard detail page ? Commented Oct 24, 2012 at 14:13
  • As you can see i did a demo in my developer and its working to display all the digits as i want Commented Oct 24, 2012 at 14:23
  • I've verified @MohithKumar 's solution in my Dev Org; created a new custom currency field with 6 decimal places and it displayed as expected (currency locale set to US.)
    – Mike Chale
    Commented Oct 24, 2012 at 17:00
  • I want to display all the decimal on the standard detail page. Commented Oct 25, 2012 at 5:41

Currency fields are formatted according to the record's currency (ISO code) and the org currency setup (Company Profile - Manage Currencies).

You have several options:

  1. Change the number of decimal places for the currency as a whole (perhaps unlikely that this will be what you want - as this will change the formatting of all currency values everywhere for that currency)

  2. Change the type of your field from "currency" to "number"

  3. Add a formula field where the output type is number and is set to 6dp, where the formula simply references your existing currency field


I have modified the currency settings under the manage currencies section.

  • 1
    I have just updated my answer relating to this option - this will change the formatting of EVERY currency field when using this currency Commented Oct 26, 2012 at 8:07
  • If my answer guided you please mark the answer - thanks :-) Commented Oct 27, 2012 at 12:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .