function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Round In Visualforce page


          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"/>

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

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.


User-added image


Praveen Murugesan

        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
Please refer this link:

Thank You.