You need to sign in to do that
Don't have an account?
Marcelo Agostinho
Formating Double to two Decimal Places
Hello...
Im having one problem trying to convert values to show on my visualforce page:
How can i convert the following number to have to decimal places...
Sometimes i ll have a number like. 42.0 other time i ll have a number like 37.3333333333333
Im trying to solve it using what i found here. but the problem is always the same.
Tks for everything
What visualforce tag are you using?
<apex:outputText> or <apex:outputField>?
If you are using the <apex:outputText> I would review the documenation here. Look at the outputText field in the Standard Component References section:
http://www.salesforce.com/us/developer/docs/pages/index.htm
With outputText can format numbers like:
<apex:outputText value="{0, number, 000,000.00}">
<apex:param value="{!Account.AnnualRevenue}" />
</apex:outputText>
All Answers
What visualforce tag are you using?
<apex:outputText> or <apex:outputField>?
If you are using the <apex:outputText> I would review the documenation here. Look at the outputText field in the Standard Component References section:
http://www.salesforce.com/us/developer/docs/pages/index.htm
With outputText can format numbers like:
<apex:outputText value="{0, number, 000,000.00}">
<apex:param value="{!Account.AnnualRevenue}" />
</apex:outputText>
Very Tks!!!
Its work perfectly for me!
Hi People,
Is there any way i can use it for input fields too?
Here is the problem im having:
I enter a decimal value 10 for an inputfield and click next to go to another block. and when i click back..the input field shows '10.0' instead of '10.00' even though im using setscale(2). any thoughts on this?
Thanks!! that helps me.