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
Administrator 88Administrator 88 

number with no decimal value

Hi,

I am very new to the Visual Force Page,

I wanted to display whole value like 1, 2, 3,.etc,. not diceimal value like 1.0, 2.0, 3.0, etc,..

How to achieve this ?
 
<tr style="display: {!IF(ISBLANK(Quotation__c.SL1__c), 'none', 'table-row')};">
  <td align="left" >{!Quotation__c.SL1__c} </td>
  <td align="left" >{!Quotation__c.Qty1__c} </td>
  <td align="left" >{!Quotation__c.Product_Description1__c} </td>
</tr>
 
Here "SL1__c and Qty1__c" fields are displaying decimal values.
Best Answer chosen by Administrator 88
Dushyant SonwarDushyant Sonwar
Hey buddy,
You can convert it into integer without any changes in class.
See this..
http://salesforce.stackexchange.com/questions/1369/display-number-output-field-as-whole-number
Hope this helps..
 

All Answers

Gaurav KheterpalGaurav Kheterpal
You can convert the fields to integer (no decimal values) by calling the intValue() method on these.

e.g.
x = y.intValue();

If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others and improve the overall quality of Discussion Forums.

Gaurav Kheterpal
Certified Force.com Developer| Salesforce Mobile Evangelist| Developer Forums Moderator| Dreamforce Speaker




 
SF AdminSF Admin
Hi,

check this https://www.salesforce.com/us/developer/docs/dbcom_apex290/Content/apex_System_Double_intValue.htm

Important :
If this is what you were looking for then please mark it as a "SOLUTION" or You can Click on the "Like" Button if this was beneficial for you.
Dushyant SonwarDushyant Sonwar
Hey buddy,
You can convert it into integer without any changes in class.
See this..
http://salesforce.stackexchange.com/questions/1369/display-number-output-field-as-whole-number
Hope this helps..
 
This was selected as the best answer