• SX
  • NEWBIE
  • 5 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

I am trying to round the decimal places that are being displayed in an outputField to remove trailing zeros. The custom field that I am trying to display is set to be a number with 7 decimal places. There are cases though where not all 7 decimal places will be used, so I want to strip away trailing zeros.


Example: If I had 10.0001000 I want it to display as 10.0001 on my Visualforce page.

 

I tried doing something like this:

 

<apex:outputField value="{0}">
   <apex:param value="{!ROUND(customField__c, number)}" />
</apex:outputField>

 This returned an error value for <apex:outputField> is not a dynamic binding!

 

If I change it to an outputText it works, but I need this field to be based on user locale which is why I was using an outputField.

 

Thanks in advance!

  • August 22, 2012
  • Like
  • 0

I am trying to round the decimal places that are being displayed in an outputField to remove trailing zeros. The custom field that I am trying to display is set to be a number with 7 decimal places. There are cases though where not all 7 decimal places will be used, so I want to strip away trailing zeros.


Example: If I had 10.0001000 I want it to display as 10.0001 on my Visualforce page.

 

I tried doing something like this:

 

<apex:outputField value="{0}">
   <apex:param value="{!ROUND(customField__c, number)}" />
</apex:outputField>

 This returned an error value for <apex:outputField> is not a dynamic binding!

 

If I change it to an outputText it works, but I need this field to be based on user locale which is why I was using an outputField.

 

Thanks in advance!

  • August 22, 2012
  • Like
  • 0