+ Start a Discussion
vfexp41vfexp41 

Round In Visualforce page

HI,

          I am displaying the values of Quote in Visualforce page, for my total amount field i have 4 decimals it showing in PDF page
$30.0000, i want to round the value in PDF  how it is possible

    <apex:page standardController="Quote__c" showHeader="false" renderAs="pdf">
<apex:repeat value="{!Quote__c.quote_items__r}" var="line">
          <apex:outputField value="{!line.Unit_Price__c}"/>
             <apex:outputField value="{!line.Total_Price__c}" styleClass="productName"/>
</apex:repeat>
</apex:page>

  how can i round the totalprice,unitprice in visualforce page
praveen murugesanpraveen murugesan
Hi,

Total_Price__c,Unit_Price__c either number field or currency field for this you need to give decimal place value 0 in filed creation. So round value will get display.

FYI

User-added image

Thanks,

Praveen Murugesan
vfexp41vfexp41
@Praveen

        both are currency fields, In data model it should be decimals-4 only but in my vf page it show the decimals which i was used, suppose in 4 decimals i used 2 decimals at that time it have to show $10.12 not $10.1200
dev_sfdc1dev_sfdc1
Hi,
Please refer this link:

https://developer.salesforce.com/forums?id=906F000000095l0IAA

Thank You.