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
uzairuzair 

How to get whole number from number field.

Hi all,

 

Is there any way such that i can get whole number as shown below.

100

instead of getting as 100.00 for number field.

 

your response will be appreciated.

 

Thanks in Advance.

Best Answer chosen by Admin (Salesforce Developers) 
uzairuzair

Hi,

 

I made use of ROUND() and it worked for me.

 

Regards,

Uzair.

All Answers

NaishadhNaishadh

use outputfield

uzairuzair

I made use of outputfield it displayed me the following error.

 

"value for outputField is not a dynamic binding!"

 

as i'm merging the field {!oppr.penrate__c} in visualforce page.

i receive the following 100.00

but i require 100.

 

hope this will help you to understand my question.

uzairuzair

Hi,

 

I made use of ROUND() and it worked for me.

 

Regards,

Uzair.

This was selected as the best answer
NaishadhNaishadh

ok in that case you have to use outputtext

<apex:page standardController="Account">
It is worth:
<apex:outputText value="{0, number, ##}">
       <apex:param value="{!Account.AnnualRevenue}" />
 </apex:outputText>
</apex:page>

 

 

uzairuzair

Thanks for your reply and time.

 

I achieved that by making use of ROUND().

 

Thanks again.