0 votes
1 view
in Salesforce by (11.9k points)

I want to display a field in a object to show just the whole number/integer value. This field has decimal values in the structure but for i need to show the integer value for this VF page only.

<apex:pageBlockSectionItem >
                    <apex:outputLabel value="# Connections" for="Connections"/>
                    <apex:outputText id="Connections" value="{!Event__c.Total_Connections__c}" />         

No of connections has to be shown as whole number.

1 Answer

0 votes
by (31.8k points)

You can utilize parametrized output with formatting, for example:

<apex:outputText id="Connections" value="{0, number, integer}">

    <apex:param value="{!Event__c.Total_Connections__c}" />


For more detail about all the formatting options, check Java's MessageFormat, the same formatting is used for <apex:outputText>

Welcome to Intellipaat Community. Get your technical queries answered by top developers !