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}"/>
</apex:outputText>

</apex:page>

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 comment:

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

    ReplyDelete