How to format the output text to show only integers, not decimal numbers with it on the Vf page

I want to display a field in an object to show only an integer / integer value. This field has decimal values ​​in the structure, but I need to show the integer value only for this VF page.

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

No connections should appear as an integer.

thanks

+4
source share
1 answer

You can use parameterized output with formation, for example:

 <apex:outputText id="Connections" value="{0, number, integer}"> <apex:param value="{!Event__c.Total_Connections__c}" /> </apex:outputText> 

For more information on all formatting options, see Java MessageFormat , for <apex:outputText>

uses the same formatting
+7
source

Source: https://habr.com/ru/post/1395883/


All Articles