You need to sign in to do that
Don't have an account?
Indu Prasad 26
Currency field in backend displays as string when used in Apex
I have a currency field on a custom object. In the object detail, the field displays properly as a currency field with the currency symbol and commas. However, I am using this field in Apex to display a table. I get only the number and no comma separators for them.
Current Line of code:
row1+='<td style="text-align:center">'+ '$' + Object__c.Revenue__c+'</td>';
If revenue is like 10000, I want it to display as 10,000. This is not happening. What can be done to rectify this issue?
Current Line of code:
row1+='<td style="text-align:center">'+ '$' + Object__c.Revenue__c+'</td>';
If revenue is like 10000, I want it to display as 10,000. This is not happening. What can be done to rectify this issue?
You should either format the field data in required format or use apex:outputField (In Visualforce page) for field data display which should auto format it.
Thanks