You need to sign in to do that
Don't have an account?
sreenath
dont need decimal value for items(number) field
Hi developers,
please solve my problem................
i am getting decimal output, i dont need only i will display number without decimal
what change i need to do?
NO. of items:<apex:outputPanel ><apex:inputField style="width:100px;" value="{!items.item1__c}" </apex:outputPanel>
this is sample code to convert number format with decimal points
<apex:page standardController="Account">
It is worth:
<apex:outputText value="{0, number, 000,000.00}">
<apex:param value="{!Account.AnnualRevenue}" />
</apex:outputText>
</apex:page>
Since you are using inputField to display it, the format is determined by the definition of the custom field item1__c . Can you change the custom field definition to not specifiy decimal positions?
Find below a sample code :
<div style="display:none">
<apex:outputPanel>
<apex:inputField style="width:100px;" value="{!items.item1__c}" >
</apex:outputPanel>
</div>
<script>
if('{!items.item1__c}' != '' || '{!items.item1__c}' != null)
{
var itm = '{!items.item1__c}';
// take only integer value from itm in IntValue variable then put it in outputtext
document.getElementById('{!$Component.xyz}').value = IntValue;
document.getElementById('abc').style.display = 'block'
}
</script>
I agree with aballard on the output view.
You could also try to remove the decimal points in your inputext field to see if that helps. 000,000 instead of 000,000.00
try this {!Text(value)}
Hey, I searched this thread to find my answer, and your response was perfect. Thanks a million!