You need to sign in to do that
Don't have an account?
acrozier
formatting a dynamic binding for currency
Hello,
I have a dynamic binding which generates the sum of a column using a SOQL query. I want this some to be formatted and displayed for currency. I can't use the param value of apex:outputext because the value is not populated until run time, so I am getting save errors. I figure I need to format this in the class and then spit out my formatted value and call that as a dynamic binding, I just can't get it to work. Can anyone help me figure out how to take this value and format it in this manor? 0, number, ###,###,##0.00
public SObject getsumIncentive(){ SObject sumIncentive; sumIncentive = [SELECT SUM(Total__c) sum FROM AIIncentive__c WHERE Job__c =:jobid]; return sumIncentive; }
Hello acrozier,
It seems you want to use the sum of Total__c using aggregate qiuery in your vf page.
so for that you need to return the sum in double format.you'll need to convert sum(sObject Row) to sum(Double).
Try this:
In the vf page you can use sumIncentive directly as its in double format.:
Hope it helps.
All Answers
Hello acrozier,
It seems you want to use the sum of Total__c using aggregate qiuery in your vf page.
so for that you need to return the sum in double format.you'll need to convert sum(sObject Row) to sum(Double).
Try this:
In the vf page you can use sumIncentive directly as its in double format.:
Hope it helps.
thank you, that worked great.