Saturday, December 10, 2016

Round Off Field Values in VF page

Suppose a field (Opportunity Amount field) value is 12.34 and you have to round off it to 1 decimal places on VF page, Then use below syntax:

<apex:page standardController="opportunity" >
<apex:outputText value="{0, number, ###,###.0}">
<apex:param value="{!opportunity.amount}"/>


Output on VF page will be 12.3

Note: This work perfectly for number ,percent, and currency fields.

Refer Below Links for Salesforce Interview Questions


  1. How beautifully all the feelings have been conveyed through writing.

  2. I just thought it may be an idea to post incase anyone else was having problems researching but I am a little unsure if I am allowed to put names and addresses on here. niche ralevant blogcomment